Saturday 15 January 2011

windows - How to run installed python script? -


I have used distutils to install my Python package, this setup.py:

 

On linux / mac, it works as expected:

 % hello World%  

On the windows, the script "PLUG" does not start:

  C: \ Python 25 \ scripts & gt; Plugh 'plugh' has not been identified as internal or external command, operative program or batch file. C: \ Python25 \ script & gt;  

I have found that bug report when I added the workaround described in that ticket when I added the Scripts directory to the PATH when I installed the python (i.e. C: \ Python 25 \ script to PAT)

  c: \ Python 25 \ scripts> path path = c: \ Python 25 \ scripts; C: \ Program Files \ Legs \ nsr \ bin; C: \ Windows \ system32; C: \ WINDOWS; C: \ WINDOWS \ System32 \ Wbem; C: \ Program Files \ QuickTime \ QSystem \; C: \ python2 5; C: \ local; C: \ wINDOWS \ system32 \ WindowsPowerShell \ v1.0  

Is there something that just does not work on Windows? And if so, how do you want to use Python script on a python machine?

I think I can recognize Windows, and I will add an additional script to the list, which is called "plugh.bat" like:

  @echo off c: Python25 \ python.exec c: \ python25 \ scripts \ plugh% 1% 2% 3% 4% 5% 6% 7% 8% 9  

But really the correct answer is here? I would have thought that with all the optimization that the distillates will have windows, there would be a better answer.

To use the expansion of windows file, determine how it will be run.

Name your file plugh.py and plugh.py to indicate it to call.


No comments:

Post a Comment