[Windows] [Python] Some help parsing variables into python
[Windows] [Python] Some help parsing variables into python
Hi, I have a python script I want to run as a post processing script. Is it possible to run it in windows directly form sabnzbd or do I have to go via a .bat file? If its possible to run it directly it would be great becuase then I would have to do anything extra/less when running on unix systems. Could you please explain which is the best way to run it and how do parse the sabnzbd variables into python so they can be used in both windows and unix. Thanks!
Re: [Windows] [Python] Some help parsing variables into pyth
If you let the Python installer properly register the .py extension, you're OK.
The ActiveState Python MSI installers do this.
You can check it by examining the PATHEXT environment variable.
How to process parameters is general Python knowledge and platform independent.
sys.argv is a list of parameters, starting with 0. 0 will give you the name of the script.
The ActiveState Python MSI installers do this.
You can check it by examining the PATHEXT environment variable.
How to process parameters is general Python knowledge and platform independent.
Code: Select all
import sys
print sys.argv