newbie question

Travis Whitton travis at grub.atlantic.net
Thu Jul 5 14:00:20 EDT 2001


I'm no expert, but I believe the following will work

# Retrieve the result of the unix date command
from os import popen
result.popen('date')
print result.read()

Hope this helps,
Travis Whitton <whitton at atlantic.net>

On Thu, 5 Jul 2001, alphaZeta wrote:

> Hi,
> 
> I didn't find any documentation (lib and tut) about how to execute a program
> in a python script.
> Does anybody know ?
> 
> For example : I would like to store in a variable the result of a call to
> the system.
> alike : >>> a = sys.exe("ls -l")
> 
> Cheers,
> 
> 
> 
> 
> 




More information about the Python-list mailing list