By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

running programs from within python

P: n/a
in general: how can i pass a string containing a concatenated sequcne of
command line arguments to a unix system CLI?

my specific problem:
i have an executable that is called xyz (written in C if that matters)
that i cannot modify, which prints it is text output to the screen and
takes an input as t.txt.
on a unix terminal, i do the ./xyz t.txt > tmp.txt
so that the tmp.txt will contain the output of the xyz executable

i tried the following but it did not work

import os
os.execl("./xyz","t.txt > tmp.txt") #the thing just hangs there
i aslo tried
os.execl("./xyz","t.txt") # but it does not output anything to the
screen either, hangs there too

any suggestions?

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.