开发者

How can I run a python script on windows?

Can anyone please tell me an IDE for ru开发者_JAVA百科nning python programs? Is it possible to run the program through command line?


Take a look at ActiveState's ActivePython. It's quite a nice implementation of Python on Windows. Another way is using Cygwin's Python port. These two are Python implementations. I don't use an IDE, I write my Python code in Notepad++.

To run a python program after saving it to C:\Users\vaibhav\Code\myscript.py:

  1. ActivePython: If I remember right, ActiveState updates the path correctly. So it should be a s simple as:

    • Press "start" in the task bar
    • In the search field search for "cmd"
    • In the appearing box navigate to your folder with the python script: dir Users\vaibhav\Code
    • call python myscript.py and you're done
  2. Cygwin: After installing Cygwin, you have a full-featured bash terminal on your Windows machine.

    • click on the Cygwin icon on your desktop
    • In the appearing window navigate to the folder with your python script: cd /cygdrive/c/Users/vaibhav/Code
    • type python myscript.py
    • e voila


IDE for running scripts? You can have any IDE you like, but if you need only to run python scripts you go like this:

python.exe pythonScript.py


I like the EasyEclipse for python distribution. You'd need to have python and java installed of course.


PyDev and Komodo Edit are 2 nice Python IDE on Windows.

I also like the SciTE text editor very much.

These 3 solutions make possible to run Python scripts


I tried to run a Python script with multiprocessing on windows. see this tutorial

It does not work on Windows, but on raspian it went very well. Thus I knew that it was a Windows problem. I installed cygwin and followed this tutorial Installing Python inside Cygwin.

After that I additionally installed numpy with the command easy_install numpy and now i can run python scripts with multiprocessing on windows (from cygwin).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜