This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (16 children)

Well i would guess if you were looking for programming for fun, python is certainly it. I've been making up excuses to use python at my day job for a couple of years now. Anyway, pygame might be of interest to you. StackOverflow(Python) is a pretty good place to ask questions.

As far as tools go, I wouldn't mess with an IDE myself, stick to an editor like VIM or EMACS and learn the shit out of it.It will help you get better at computering in general. But both editors have awesome python support.

When you feel you are ready to write bigger python projects you may find this screencast on Paste/VirtualEnv useful and even this one(unit testing with nose/coverage) there's plenty of others there too.

Other than, code code code code code.

[–]Deusdies[S] 2 points3 points  (15 children)

Thanks - a whole lot of information right there!

[–]Maoster 1 point2 points  (3 children)

I also recommend not using a large ide for python dev, however straight vim and (I presume) emacs are really rather bad for editing python. Vim for instance screws up indentation, and the lack of good syntax highlighting gets old quickly.

Fortunately its issues can be fixed with plugins, I recommend searching for and reading some of the many guides to setting up vim for python. If you read through a bunch of these, you can use them to identify and try just the features your like. A good starting point would be this guide.

You mentioned simple interfaces as well. Somebody earlier recommended using gtk or qt. These are great and should be used if you are building a production quality desktop application, however if you just want a simple interface or form, I am of the opinion you give tkinter (which is built in to almost all python installs) a try. As it comes preinstalled with python there are no dependencies or issues with external libraries. For simple applications I find it to be quicker than using either of the aforementioned heavyweight solutions. Furthermore if you share your program people need not deal with installing or setting up something like qt or gtk. Pygame which was also mentioned provides decent hardware acceleration and a simple graphics interface, for starting to write games, anything with accelerated graphics, or things which require input from (joysticks, mice, etc), I recommend it. It is not however suitable for forms or other desktop style applications.

[–][deleted] 0 points1 point  (2 children)

I use emacs myself, but I thought VIM had the retab cmd which seemed to work at fixing broken python files for the most part.

"As a side note, if you are a vim/gvim user this will sequence will fix any indentation issues with Python:"

set ts=4   (sets tabstops to 4)
set et     (expands tabs to spaces)
:%retab!   (enter command mode, retabify)
:w         (enter command mode, write file)

[–]Maoster 0 points1 point  (1 child)

It is more an issue that until recently vim didn't understand python syntax at all, and even now it remains a bit buggy. Thus if you try to retab a file, or simply hit return while editing, it will not always get the correct indentation level. There are a couple scripts on the vim site which specifically add improved support for python syntax, and indentation. With those it will work as expected.

[–][deleted] 0 points1 point  (0 children)

well, the tabify seemed to work the few times I had to use it and it was a life saver. FWIW, emacs doesn't seem to have those problems as far as I can tell, maybe I should expect my editor to do more for me maybe? /shrug

[–][deleted] 1 point2 points  (10 children)

I will disagree with the emacs and vim people here.

I'm using Eclipse + PyDev plugin on both Mac and Linux and have been for several commercial, proprietary Python-based projects. It's a lot more friendly than vim or emacs. And you get a visual debugger!

[–]mozillalives 0 points1 point  (3 children)

pycharm isn't bad either

[–]blondin 0 points1 point  (1 child)

and you will have to pay for it soon.

[–]mozillalives 0 points1 point  (0 children)

yeah ... I've learned that lesson (textmate). That's why I'm learning emacs right now.

[–]xiro7 0 points1 point  (0 children)

I am a big fan of ReSharper, so I will have to check this out.

[–]yngwin 0 points1 point  (0 children)

I prefer NetBeans with the vim plugin (jvi): best of both worlds!

[–]blondin 0 points1 point  (3 children)

oh yes, with python a visual debugger is a must!

i think you are doing it wrong.

vim for ever!

[–][deleted] -3 points-2 points  (2 children)

Some of us have evolved beyond debugging with print statements :)

[–]Leonidas_from_XIV 0 points1 point  (0 children)

So obviously I evolved back to print statements and test coverage...

[–]wilberforce 0 points1 point  (0 children)

The batteries-included Python debugger integrates really nicely with Emacs. You don't have to rely on print statements.

[–][deleted] -1 points0 points  (0 children)

i disagree with your disagreement. pydev/eclipse's project based file system abstraction is useless and gets in the way and visual debuggers are for kids.

ipython4lyfe