Re: [Tutor] subprocess output

2010-07-28 Thread Evert Rol
> #!/usr/bin/env python > import subprocess > import sys > > dom = sys.argv[1] > switch = sys.argv [2] > answer = subprocess.call("whois " + dom, shell=True) > > Execute the above (whatever.py -example.com -a1) prints the entire WHOIS > output, but I just want it saved to the variable 'answer', n

Re: [Tutor] subprocess output

2010-07-28 Thread Sander Sweers
- Original message - > I'm using Python 2.6.5 and I've got a challenge with the subprocess > module. I'd like the output to be stored in a variable, and not sent to > the stdout. The relevant lines as they are now: Go to google, enter "pymotw subprocess" and hit I am feeling lucky ;-) gre