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:
#!/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', nothing more. Changing 'shell=True' to 'shell=False' raises an exception and removing the 'shell=' altogether is troublesome as well. Thoughts on how I can accomplish this? Thanks! _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor