PDA

View Full Version : The best free Python IDE?



gh0st
December 18th, 2006, 11:42 AM
Hi,

I have just started out using Python and I am looking for a decent open-source IDE to use. I've heard a few people saying you shouldn't bother with an IDE and just use something like gedit but this sounds a bit painful. I had a look at Komodo and Wing but bot are commercial and I don't really wanna spend any cash until I decide if I'm gonna stick with Python. I'm just a cheapskate really :-)

Does anyone have a suggestion for a good free IDE I could use, I want something that I can design my GUI with as well if possible? I have seen KDevelop before and tried it briefly with Java. Is that the best thing to use?

Thanks for your help

Dan

Wybiral
December 18th, 2006, 11:50 AM
If you are just starting with a language, it's usually best not to use an IDE as this will encourage you to memorize the syntax and keywords as opposed to relying on the IDE to solve your problems... I'm one of those people, use gedit, lol.

gh0st
December 18th, 2006, 11:58 AM
Yeah thats a good point. I didn't really think about that. I am using IDLE at the moment but it's basically just another way to get at the Python command line tool. Does gedit at least highlight code for you?? Forgive my ignorance about gedit :-) I can live without the wizards and things I suppose but it would be nice to have the code highlighted.

Wybiral
December 18th, 2006, 12:04 PM
Gedit highlights code for almost anything (and for what it doesn't you can write a file and add your own highlighting). It does highlight python and it is very simple and easy to use. I use gedit for all of my programming, then I compile in the command line.

daniminas
December 18th, 2006, 12:27 PM
I'm always been searching for a python IDE.. like Zend to PHP is.. but i'm still using Gedit :-k

gh0st
December 18th, 2006, 02:51 PM
I think I'll start with gedit to learn best programming practices and so on but I would still like to move to something a bit easier for doing GUI projects and stuff. I've heard that Glade is good for that sort of thing and it intergrates with most languages easily.

pmasiar
December 18th, 2006, 03:01 PM
If you are just starting with a language, it's usually best not to use an IDE as this will encourage you to memorize the syntax and keywords as opposed to relying on the IDE to solve your problems... I'm one of those people, use gedit, lol.

Except python does not have much of a syntax to remember. :-)

I really love SPE (Stani's Python Editor), because

it has outline tab (list of function names only and special "bookmark" comments) to quickly move around my code,
warns you if you use non-matching quotes for strings.
shows indentation guides (I love it and I wish eclipse has it). Indentation has syntax meaning in python, so you are better off with good IDE.


Synaptic will install SPE for you in 1 click. Don't waste your time in plain text editor.

gh0st
December 18th, 2006, 03:11 PM
Thanks for the advice, I'll certainly look into SPE. I am learning Python at the moment from the eBook "Dive Into Python" which is available free at their website.

http://www.diveintopython.org/

I highly recommend it to anyone who knows how to program in another language and wants to learn Python. It just tells you what you need to know and not all the "What Is A Programming Language?" type rubbish you normally have to skip :)

Wybiral
December 18th, 2006, 03:20 PM
I still think you'd be much better off getting used to the indentations and syntax in a regular editor.

To pmasiar: :p

tzulberti
December 18th, 2006, 03:59 PM
Thanks for the advice, I'll certainly look into SPE. I am learning Python at the moment from the eBook "Dive Into Python" which is available free at their website.

http://www.diveintopython.org/

I highly recommend it to anyone who knows how to program in another language and wants to learn Python. It just tells you what you need to know and not all the "What Is A Programming Language?" type rubbish you normally have to skip :)

Yes, I am also learning python, and that is the best book ever...

jordilin
December 18th, 2006, 04:20 PM
I would give Eric a try. It's in the repos and has a nice debugger. It will help a lot when learning python

pmasiar
December 19th, 2006, 04:33 AM
I think I'll start with gedit to learn best programming practices and so on but I would still like to move to something a bit easier for doing GUI projects and stuff. I've heard that Glade is good for that sort of thing and it intergrates with most languages easily.

You cannot trust Wybiral: his computer is powered by steam engine (which also warms his cave). :twisted: We use metal tools.

To learn best programming practices, you don't scratch your code on stone tablets :-) instead, read Python Cookbook (http://aspn.activestate.com/ASPN/Python/Cookbook/) recepies relevant to your tasks, or other examples of good code - read code of python gurus to learn more, not your own :-)

Glade is part od SPE - SPE itself was created somehow as part of Blender project, but I don't remember the details.

Wybiral
December 19th, 2006, 04:46 AM
LOL!

But also, it's easier to learn when you actually do the typing yourself, just cut&pasting tutorials into an IDE isn't going to help. And having to type it without correction lets you find your own errors using the interpreters debugger (which is a good thing to get used to doing).

To pmasiar: Personally, I just think it's overkill to use a plasma rifle to pop a balloon when a simple needle will do. The plasma rifle might look cooler doing it, but the needle doesn't take as long to charge up. *Analogy of the day* :)

pmasiar
December 19th, 2006, 05:53 AM
Wybiral, my friend, you are totally right! I see it now: Needle is the right dynamic solution! Plasma rifle is slow enterprisey overkill! :-P

Way off topic now, let's be done with it now. I won on points, you on funniest analogy :-)

gh0st
December 19th, 2006, 01:11 PM
I can't believe a discussion of Python IDE's caused such a heated debate :-)

I think you both make good points. Just copying and pasting code doesn't teach you anything but I don't think you have to go through every inch of the language in a basic text editor either. It's down to the individual to decide the best approach for them.

studiesrule
December 19th, 2006, 01:46 PM
what about PyPE. It's a pretty good editor, but I recommend building a more recent version than in the repos.
IDLE's pretty effective too. It's debugger is great, and it has code completion and all.

pmasiar
December 19th, 2006, 02:19 PM
I can't believe a discussion of Python IDE's caused such a heated debate :-)

Heat in this debate has nothing common with IDE, it is completely off-topic.

We were jabbing on each other with Wybiral about python, java, c++ for all past week on other threads. With cave and steam powered computer I **almost** got him, but I admit laser rifle is **way** too enterprisey. So close! But it was decent fight. :-)

thomasaaron
December 20th, 2006, 01:14 AM
I get along fine with IDLE.

I can see the previous points of just using gedit, though. Maybe I should try that.

TTob
December 20th, 2006, 12:38 PM
To learn best programming practices, you don't scratch your code on stone tablets instead, read Python Cookbook recepies relevant to your tasks, or other examples of good code - read code of python gurus to learn more, not your own

I already familiar with python but I need to learn good python programming habits. Can you guys tell me where can I find such guru's code ?

*sorry about my bad English

pmasiar
December 20th, 2006, 02:54 PM
Guru code: ASPN Cookbook above, any python module from standard library, or just join any python project of your interest. Every development team needs something like TRAC (http://trac.edgewall.org/), so it might be useful to know it. Or become an expert in python IDE of your choice -- so you can add new features if you need one.

IMHO, after you are familiar with syntax, but before you can be usefull for any real-life project, you need to

(1) learn about data structures (http://en.wikipedia.org/wiki/Data_structures).
(2) solve some small tasks: smaller than real projects, but bigger than book examples. I collected some tasks at learrnPYdia (http://learnpydia.pbwiki.com/), feel free to add more (or msg me with links)

After some excercise, you should be ready to join some project. If you want me to give you tips for my 2 favorite features missing in SPE editor, just ask. :-)

TTob
December 21st, 2006, 12:28 PM
pmasiar, thank you very much for the advices.

pmasiar
December 21st, 2006, 03:43 PM
Let me copy this reply from other thread:

I am one of the guys who prefers SPE. Not only because it is easy to install and you can use it also on Mac and Win. I really like

indentation guides (specially important for Python),
I prefer to set strings to have background color - so you can see string literals, like hash keys, easy
line goes purple if you don't close your string correctly (like opening with single and closing with double quote). In other editors, it is hard to see error: closing quote is of a string color
you can set comments to have background color - so its easy to see code you commented out (very light brown for me) instead of italics, which is hard to read on monitors
I love the sidebar code outline mode - Explore. One line per function definitions, plus special comments: ##--- for permanent bookmarks, ##TODO, ##FIXME. It is MUCH easier to move around in your code using smart sidebar


I have no problem with gedit and use it daily. But: gedit is editor optimized to edit plain text. Python has additional structure which gedit is ignorant about. Arguments about learning syntax "the hard way" is bogus - maybe good for C++, if you are into BDSM and enjoy the pain :-) but not valid for python.

The only thing SPE is missing is printing. I print from gedit :-)

micahkoga
December 21st, 2006, 05:12 PM
You should check out pyDev for Eclipse. http://pydev.sourceforge.net/

It has all the basic eclipse functionality for python.
I wish they would come out with a python plugin for netbeans though.

kperkins
December 22nd, 2006, 12:09 AM
Here's another vote for SPE. For all the reasons the pmasiar mentioned. Plus it is helpful, showing arguments and syntax for different modules.
Eclipse is just too bulky for me.

lloyd mcclendon
December 22nd, 2006, 05:30 AM
You should check out pyDev for Eclipse. http://pydev.sourceforge.net/

It has all the basic eclipse functionality for python.
I wish they would come out with a python plugin for netbeans though.

yeah i have this at work but it's not free

kind of annoying, ever so often at random it pops up a modal dialog box and the ok button is disabled for longer and longer periods of time. i'll be in the zone busting out code in java land and it pops up and kills my rhythm.

it's not that great, the ctrl+space thing is sketchy and thats all i really want since i'm not all that familiar with the api.

now that i have JadClipse installed i'm gonna hack pydev to cut out that dialog box ****. i'm gonna be cracking a lot of programs in the next couple weeks. jad makes any sort of code that forces you to buy something that should be free very easy to fix. a well placed ! is all you need

gh0st
December 22nd, 2006, 04:55 PM
Well, I've been a bit busy but I finally got my act together and installed SPE, following the consensus of advice. I haven't done much with it yet but on first impressions I'm very pleased with it. Thanks for the advice everyone.

Remember, it's the code you write that matters not the program you write it with :-)

Wybiral
December 22nd, 2006, 11:06 PM
Remember, it's the code you write that matters not the program you write it with

Well said... Also, you shouldn't need an IDE for python, next to BASIC it's probably the easiest language to learn/use there is.

maxamillion
December 22nd, 2006, 11:10 PM
vim

geek_Man
December 25th, 2006, 07:29 PM
I don't know if anyone has mentioned it, but I just downloaded Pida and looks really nice! Just my two cents. Merry Christmas!

mordox
December 26th, 2006, 04:51 AM
i also use gedit and its simplicity is what i like the most

weaver4
January 7th, 2007, 08:37 PM
I have been using VS in windows for a while; I am spoiled by code completion. Plus I am a really bad speller. Any ide's with Code Completion?

gpolo
January 8th, 2007, 03:35 AM
hum... if a project starts getting big, I would prefer to use eclipse with pydev. If you are doing small things, vim and gedit would be good enough

pmasiar
January 8th, 2007, 05:44 AM
I have been using VS in windows for a while; I am spoiled by code completion. Plus I am a really bad speller. Any ide's with Code Completion?

You are missing the point my friend. If you use dynamically typed language like python, **by design** there is no association between variable name and it's type until runtime. **That's why** the language is called "dynamically typed" :rolleyes:

Some help can (and it is) provided if a name is imported module, but that's all. SPE also tries to suggest methods previously used for same name.

In python, you have 1/3 of the lines to write, so wake up and write them. :twisted:

I was contemplating why so much bad code is written in these smart IDEs like VS and Eclipse. And I think I know why: :-) They are very submissive, creating lines and lines of code is easy - so you go ahead and do it. Traditional code editors (I call them plain editors - but not as plain as notebook) are optimized not for generating lines of code, but for making change in it. So with plain editor, when facing with choice write more code, or modify existing code to handle new tasks, often is easier to edit/refactor than generate new code. So if you can avoid copy/paste with plain editor (and you still have to edit, and everyone knows that copy/paste is BAD), you will generate LESS code that with "smart" IDE. And IMHO less code is GOOD. Less code to maintain and debug. Productivity should be measured not in lines **written** but in lines **spent"" 8^)

ghostdog74
January 8th, 2007, 09:11 AM
You are missing the point my friend. If you use dynamically typed language like python, **by design** there is no association between variable name and it's type until runtime. **That's why** the language is called "dynamically typed" :rolleyes:

Some help can (and it is) provided if a name is imported module, but that's all. SPE also tries to suggest methods previously used for same name.

In python, you have 1/3 of the lines to write, so wake up and write them. :twisted:

I was contemplating why so much bad code is written in these smart IDEs like VS and Eclipse. And I think I know why: :-) They are very submissive, creating lines and lines of code is easy - so you go ahead and do it. Traditional code editors (I call them plain editors - but not as plain as notebook) are optimized not for generating lines of code, but for making change in it. So with plain editor, when facing with choice write more code, or modify existing code to handle new tasks, often is easier to edit/refactor than generate new code. So if you can avoid copy/paste with plain editor (and you still have to edit, and everyone knows that copy/paste is BAD), you will generate LESS code that with "smart" IDE. And IMHO less code is GOOD. Less code to maintain and debug. Productivity should be measured not in lines **written** but in lines **spent"" 8^)


hmm..i thought code completion is something like for example, when you type "os." at the editor, the editor
will show you something like a list of all the methods of os module, then you can select that module, without spelling them out? ( by tabbing like in Pythonwin? )...
correct me if i am wrong about what OP has asked though....:)

bug4re
January 8th, 2007, 10:32 AM
I'd tried some python IDEs ,

when i looked back i realize my favorate one is the first one which named IDLE.

It's simple and elegant that's all i want.

Except IDLE, i prefer vim with some python scripts.

johnnymac
January 8th, 2007, 02:38 PM
I'm a fan of spe (sudo apt-get install spe)....been using it for a bit now and it's super on resources.

pmasiar
January 8th, 2007, 03:20 PM
hmm..i thought code completion is something like for example, when you type "os." at the editor, the editor
will show you something like a list of all the methods of os module, then you can select that module, without spelling them out? ( by tabbing like in Pythonwin? )...


Yes all python IDEs I tried (IDLE, SPE, Eric) will handle methods of imported modules you want as I mentioned in my post.

IDEs for static languages like java, after incantation ObjectType myobject = new ObjectType; can provide you with methods for that type, which I thought you also want - and cannot have because of duck typing.

BTW you don't have to fully quote all my comment - quoting only the part relevant to your question is preferable, quote provides link to original if someone needs more details. Save the electrons!

weaver4
January 8th, 2007, 05:01 PM
hmm..i thought code completion is something like for example, when you type "os." at the editor, the editor
will show you something like a list of all the methods of os module, then you can select that module, without spelling them out? ( by tabbing like in Pythonwin? )...
correct me if i am wrong about what OP has asked though....:)

Yes, that is what I meant. But; I think, I have been scolded about something else. Mom, I didn't do it...I promise.

geek_Man
January 8th, 2007, 06:30 PM
I tried IDLE, but it's pretty ugly (I think). If you're going to have an IDE for something it might as well look nice. My other two cents.

gh0st
January 8th, 2007, 10:19 PM
Yes, that is what I meant. But; I think, I have been scolded about something else. Mom, I didn't do it...I promise.

:) Don't worry I think pmasiar thought you meant code generation which you get a lot in VS. Like when you add a DB connection by dragging and dropping the dataset icon and it automatically generates all the connection code for you with wizards. I have agree that this isn't a great way of working from an optimization point of view and from personal experience you don't know where to look when things go wrong.

Code completion is more like a prompt or a suggestion I would say. Having a list of methods pop up when you type an object name is nice and also useful. I don't think anyone objects to that, I know I don't ;)

... and I have to admit I have used the odd wizard in my time. Nobody's perfect :-)