2

I'm locked in using C# and I don't like it one bit. I have to start branching out to better myself as a professional and as a person, so I've decided to start making things in my own time using Python.

The problem is, I've basically programmed only in C#. What IDE should I use to make programs using Python?

My goal is to make a sort of encyclopedic program for a game I'm playing right now, displaying hero information, names, stats, picture, etc. All of this information I'm going to parse from an XML file.

My plan is for this application to be able to run under Windows, Linux and Mac (I'm under the impression that any code written in Python works 100% cross-platform, right?)

Thanks a lot for your tremendous help brothers of SO. :P

Edit:

I guess I should clarify that I'm looking for an IDE that supports drag and drop GUI design. I'm used to using VS and I'm not really sure how you can do it any other way.

2

11 Answers 11

5

How about IronPython

As of VS 2010 it will become a first class .Net language

Or currently in a VS2008 shell IronPythonStudio

Not that I have used any of these

In hindsight this may not make for a very good cross platform solution, but it will allow you to leverage your VS experience

3
  • Crap. Microsoft is just tightening it's grip around me neck isn't it. Oct 4, 2009 at 21:49
  • @Papuccino - well you can blame other people for .Net on Linux and Mac :D
    – Peter M
    Oct 4, 2009 at 21:52
  • I second the recommendation for IronPython, and would specifically warmly recommend a great book about it: "IronPython in Action", see manning.com/foord . Oct 4, 2009 at 23:38
3

You don't really need an IDE for Python; just a good text editor. An IDE you might like though is Editra. It is actually written in Python itself, so you can use it on Linux, Mac, and Windows! I used Editra as my Python IDE for about 6-10 months. It gives you all you need and nothing more: syntax highlighting, code folding, auto indenting, and optional plugins to integrate a Python shell right into the editing window. You'll definitely want auto indenting when you are coding in Python.

As for designing GUIs visually, I suggest you check out Glade. It allows you to design GUIs easily with the GTK+ toolkit. (GTK+ GUIs work on Linux, Mac, and Windows!) It will take a bit more effort to integrate them into your Python programs than it does in Microsoft's Visual languages, but it isn't that bad once you learn it. The nice thing about using GTK+ and Glade is that you design your interface using containers, padding properties, and things like that. It is possible to design them dragging and dropping anywhere on the grid like in Visual Studio, but who wants to do that? Once you learn your way around containers and padding, you'll be very happy with them. It's much easier to make everything even, and to have similar widgets grouped together for hiding/disabling and things like that.

Good luck in your Python journey! :)

1
  • Exactly the type of answer I was looking for. Simple, easy, and chock full of valid information. +1! Oct 5, 2009 at 1:18
2

I think Wing IDE also deserves to be mentioned. I was a VIM user for years, but am currently thinking about changing to Wing. It costs money, but after evaluating for about a week (you can do a 30-day eval), I feel it will be well worth it.

I do not have any experience using the other IDEs (Komodo, Eclipse) mentioned. So they might be even better than Wing. It would be interesting if someone who has experience with all of them could describe some of their differences, strengths and weaknesses.

That being said, I recommend learning Python using a basic approach - use a text editor like Notepad++, VIM or emacs to learn the basics. Learn to use the standard Python debugger, pdb, from the command line. And use the interactive shell when learning (use IPython for interactive work).

Switch to an IDE when you master the basics.

There is also a very basic IDE in the Python distro: IDLE.

There are a lot of great tutorials and books on Python available. Start with the standard documentation. A lot of people like Dive into Python. I also recommend Python in a nutshell.

2
  • I agree that I should learn the syntax a bit using Notepad++, however why should I use the compiler from command line? My program isn't going to be a console one, it's going to be a window. Oct 4, 2009 at 21:53
  • There is no compile step with Python, it's interpreted. To execute a python program in filename.py, you type python filename.py on the cmd line (or doubleclick on filename.py, if you're in a graphical environment).
    – codeape
    Oct 4, 2009 at 22:00
1

Good IDE for python are Komodo or Eclipse with PyDev.

But even Notepad++ or any other text editor will enough to get you started, since you don't need to compile your code, just have a good editor.

The benefit of the above IDEs, is that you can use them to manage a large scale project and debug your code.

As for the cross platform issue, as long as you don't use the specific os libs (such as win32api), you are safe in being cross platform.

Seems like a very large project for a first time. Is it going to be web based or desktop? Since it will greatly change your design and choice of python libs.

5
  • Hello, thank you for the answer. I'm a bit confused, my code won't need to be compiled? How can I test my program then? (In VS I just pressed F5). Also my program will be a standalone .exe file. Oct 4, 2009 at 21:43
  • haha, compilation is the worse type of unit tests ;). You don't compile the code - that's right. The code is interpreted. Hence to test the code, you write tests :D. If you are a total newbie, read Dive into python first... Oct 4, 2009 at 21:46
  • 1
    No... python IS compiled (to byte-code... all those PYC files you see in your workspace) - it's just that it happens automatically. You do not need to worry about it. In Eclipse you press F9, but it means much the same thing. Oct 4, 2009 at 21:54
  • 1
    No compiling under python. Its an interpreter language, like JavaScript. You write and execute. You can start here
    – Amirshk
    Oct 4, 2009 at 22:03
  • Python is a bytecode compiled language (actually much closer to Java than Javascript). Those .pyc files you see are the result of the python compiler - they are litterally compiled Python code ready to be run. Oct 4, 2009 at 23:21
1

For dynamically typed languages power editors like Vim and Emacs make excellent IDEs. You can use GUI tools to make your layout and still use Vim/Emacs for development. Because there is no compile it is very fast to test your code e.g.

:! python % 

1

Python is so simple that IDE's aren't as necessary as they are with C# and VB.

A "complaint" is that the Python IDE's don't do very much. This shouldn't be counted as a complaint -- it's a virtue of the language.

We use Komodo Edit for professional work. It does much of what we need.

5
  • 1
    You NEED an IDE. Seriously - I do not care which one you use... Emacs, Eclipse, whatever. You are at a serious disadvantage using even a good programmer's editor. Oct 4, 2009 at 21:51
  • @Salim Fradhley: Really? Why? I use IDLE and BBEdit pretty regularly. What am I missing? What disadvantage am I suffering from? Can you specifically name the disadvantages?
    – S.Lott
    Oct 4, 2009 at 21:59
  • @Salim: all caps don't give your opinion any more weight. Could you please explain why? and what exactly are you not agreeing about with S.Lott? Oct 4, 2009 at 22:00
  • 1
    The phrase "Python is so simple that it doesn't need an IDE" is just ridiculous. Some more detailed argumentation is in order. Oct 4, 2009 at 22:14
  • Using Python you can choose for yourself what dev. style that fits you. This is a Good Thing. Enjoy being helped along by an IDE? Go. Enjoy the calmness of VIM? Do it. Do whatever feels right for you. If you come from a .NET background you basically have one option: Visual Studio (yes, I know you can do csc.exe from the cmd line or use MonoDevelop, but how many devs do that? 1%? 0.1%?).
    – codeape
    Oct 4, 2009 at 22:26
1

I'd vote for Eclipse +pydev (especially that pydev extensions were released recently as open source). You can also use either VIM or emacs for python development.

Also, I'd recomment the great Dive Into Python

0

Eclipse + Pydev is currently the gold standard IDE for Python. It's cross platform and since it's a general purpose IDE it has support for just about every other programming activity you might want to consider.

Eclipse is not bad for C++, and very mature for Java developers. It's quite amazing when you realize that all this great stuff costs nothing.

0

I suspect you'll have a hard time finding an IDE with an integrated GUI designer, I think. But most GUI toolkits have drag and drop designers you can use to design dialogboxes and windows, and then use from Python, even if it's not integrated with the GUI. You'll learn soon enough.

Here is a question asking for GUI designers for Python: Delphi-like GUI designer for Python

0

In terms of GUI editing, take a look at wxwidgets, and in particular XRCed.

XRCed is an application for generating interfaces (not quite drag and drop, but close) which are then saved as XML files. Using wxPython you can then load the XML file and it will rebuild the interface for you.

You then just need to obtain references to each of your UI elements (by name) and you can get on with the real work.

0

I find SciTE to be a good alternative to Notepad++. It's very lightweight, but has very good support for language highlighting, and in-editor script execution. It also has one of my favorite editing gestures from Visual Studio: Ctrl-F3, picks the word at the edit cursor, makes it the search text, and searches for the next occurrence.

PyScripter is the next step up IDE I would suggest, giving a nice class browser window, just like VS.

For interactive debugging, I use winpdb (which, despite the name, is not a Windows-only utility).

Not the answer you're looking for? Browse other questions tagged or ask your own question.