I am still fairly new to the python world and know this should be an easy question to answer. I have this section of a script in python that calls a script in Perl. This Perl script is a SOAP service that fetches data from a web page. Everything works great and outputs what I want, but after a bit of trial and error I am confused to how I can capture the data with a python variable and not just output to the screen like it does now.
Any pointers appreciated!
Thank you,
Pablo
# SOAP SERVICE
# Fetch the perl script that will request the users email.
# This service will return a name, email, and certificate.
var = "soap.pl"
pipe = subprocess.Popen(["perl", "./soap.pl", var], stdin = subprocess.PIPE)
pipe.stdin.write(var)
print "\n"
pipe.stdin.close()
var? Do you want to send the script the content ofvaron the command line or do you want to send it to its STDIN stream?pipe.stdin.write(var)then the objectpipethat represents the process is sending the contents ofvarto STDIN of the script it invoked. The partstdin = subprocess.PIPEis needed when you want to feed someSTDINinto a program as it runs. It sounds like you don't need that here.