[Tutor] Using command line tool with python script
Oleg Oltar
oltarasenko at gmail.com
Mon Oct 5 16:22:43 CEST 2009
Hi!
I want to try to use a command line script with my python application. The
task is the following, my database stores some initial data for the script
and
I need to execute a command line application in a following way:
$ application -parameter1 -file1
where file 1 is a file which contains my initial data, and parameter1 is
unrelated parameter
the workflow as I see it know is following
initial_data = get_initial_data_from_db()
file = open('temp.txt', 'w+')
file.write(initial_data)
file.save()
os.popen4("application -parameter1 -file temp.txt")
I wonder if that possible to execute this script (called application)
without writing the file with initial data to the hard disk?
Thanks,
Oleg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091005/8ac8f1dd/attachment.htm>
More information about the Tutor
mailing list