Run a python script as an exe and run a new process from it

Paddy O'Loughlin patrick.oloughlin at gmail.com
Fri Feb 27 12:22:21 EST 2009


2009/2/27 venutaurus539 at gmail.com <venutaurus539 at gmail.com>:
> Thanks for the reply,,
>            I am trying to use the above application using psexec()in
> command line.But it failed returning the error message
>
>  exited with error code 255.
>
>              But when I ran the application normally it worked
> fine.Do I need to add anything to my python script(either the main one
> or the script which is calling it) to make it work.

I don't have any experience with psexec, so I'm not sure if I can help
you with that.
I assume this means that you are trying to run the script on a remote
computer? (Elsewise, why use psexec?)

I took a look at it though and it seems that it always exits with
*some* error code. I think it's more usual for that error code to be
zero, though (it does when I run it on my machine).

You might try "psexec start script1.py", which might work if you've
successfully set Explorer to run .py files with python.exe when you
double-click on them.

"psexec python script1.py" will work if the python.exe is in the correct path.

You can also specify the full path to your python.exe. if you know it
e.g.: "psexec C:\python25\python.exe script1.py"



-- 
"Ray, when someone asks you if you're a god, you say YES!"



More information about the Python-list mailing list