Run Python script from file

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Run Python script from file

Post by oryagel »

Hi,
I have a very simple script that I try to execute as a Shell Script:
import sys
print sys.argv[1]
print sys.argv[2]
print sys.argv[3]
print sys.argv[4]
It works as expected when I paste the script in the script box and use the command:
C:\Python27\python.exe %Script% %Params%
I want to start the script from a .py file
So I tried to put the following in the Script box:
"D:\Tools\test.py" %1 %2 % 3 %4
But then I get an error:
TypeError: not all arguments converted during string formatting
How should I execute the script properly?

Thanks
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Just specify start cmd like the following:
C:\Python27\python.exe "D:\Tools\test.py" %Params%
Script field leave empty.
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Works.
Thanks
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome.
Post Reply