Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Run a external program.

Reply
Thread Tools

Run a external program.

 
 
Yasser Almeida Hernández
Guest
Posts: n/a
 
      11-14-2009
Hi all!!

I'm writing a script where i call a external program which receive
some arguments.
One of this arguments is stored in a variable, that is passed as
argument as well:

import os
....
f = open(file1, 'r')
s = 'command $f -i file2 -w 1.4 -o file3.out'
os.system(s)
....

When i run the script i get the next message...
'-i: No such file or directory'
.... with a obvious error in the exit of the program. If i remove the
option -i i get the same error with every option, even with those who
don't get any file as argument. (file2 exist).
BUT, when i run the external program in a python shell, it works...

What's wrong?

Please help me...
Thanks








--
Lic. Yasser Almeida Hernández
Center of Molecular Inmunology (CIM)
Nanobiology Group
P.O.Box 16040, Havana, Cuba
Phone: (537) 271-7933, ext. 221

----------------------------------------------------------------
Correo FENHI



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Western Digital EXTERNAL "Elements USB model" drive - How do I run it run under Windows 98 please me Computer Support 3 09-29-2008 09:40 PM
Re: CGI won't run external program - Expect - ans'ed my own question chuck Firefox 0 11-15-2005 12:00 AM
Create references to external scipt files from within an external script file Mellow Crow Javascript 6 11-04-2005 01:16 PM
CGI won't run external program - Expect chuck Firefox 0 07-30-2005 03:44 PM
unresolved external symbol/using an external dll Scott Allen C++ 8 05-02-2004 06:11 PM



Advertisments