Re: os.system()- cannot add parameter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: os.system()- cannot add parameter

    En Wed, 20 Aug 2008 04:20:15 -0300, aditya shukla
    <adityashukla19 83@gmail.comesc ribi�:
    I have a program which is in the form of a client-server. i wanna send
    the
    parameters from my python script such that the client passes it to the
    server.this is what i have done
    Server is running in vmplayer.This is what i have done
    b="c:\progs"
    os.system('star t c:\\pnew\\xyz\\ win32\\xyz' + " " + b) -- now this runs
    the
    xyz.exe but does not accept the parameter, where as if i directly give
    >
    xyz c:\progs through the client(from cmd.exe) then this works.
    I'd use the most basic debugging tools - print and repr:

    b="c:\progs" # ensure it is correctly escaped
    cmdline = 'start c:\\pnew\\xyz\\ win32\\xyz' + " " + b
    print repr(cmdline)
    os.system(cmdli ne)

    --
    Gabriel Genellina

Working...