Skip to main content
gamedev.net
🔒 Locked

Python development tips and tricks needed

Started by Structural 8 replies 1.5k views
Original Post
Structural
Structural
So I started python programming at work a few weeks ago, and coming from languages like C# and C++ and the VS IDE, I find python somewhat tedious to work with because of the lack of "intellisense-like" features for modules that I wrote myself and the lack of a compile step. Whenever I use a class I have to dig in the source to find the member/method name that I want.
Also renaming members/methods is hard because you only find out at runtime if you renamed all occurrences.

I'm currently using the IDLE IDE and running my scripts from the commandline.

Do you people have any tips and tricks for me that would make life easier for me?

thanks in advance.
STOP THE PLANET!! I WANT TO GET OFF!!
Hyrcan
Hyrcan
I'm doing professional Python development, so I paid for a license of the wonderful Wing IDE, but I also heard good things about PyDev, which also offers code completion and code hints.

It might help you in your learning phase, providing constant on-screen hints. IDLE is not really an IDE, it's about as basic as you can get. You might get a better experience using a somewhat smarter IDE.
EricRRichards
EricRRichards
I second the recommendation for WingIDE, I have the personal edition, which is pretty cheap, and has pretty good intellisense.
If you want something that is free, I've had good luck with Geany. Not quite as nice as Wing, ie the intellisense only operates on symbols defined in your open source files, not imported library modules (as best I have been able to determine). However, in my experience it is a little bit lighter-weight than Wing, and is very serviceable for working with Python.
stonemetal
stonemetal
Have you tried Iron Python? It is python on .net and it comes with visual studio integration at least for VS 2010 not sure about older versions.
theOcelot
theOcelot
Since you appear to be on Windows, PyScripter may be a good pick. I've recently started using it for Windows python development. It's not exactly a mature program; there are a few bugs and things that don't work right all the time. But the debugger works fine, and IMO that's the most important thing an IDE has to offer. Basically, it does the job.
smr
smr
I recommend Eclipse with the PyDev extension. It offers decent autocompletion and the debugger works. It also has a lint, so it'll warn you of some errors in your code before you run. It's not going to catch everything, and may even give you some false errors, but it's better than nothing. If you use any external python packages in your application you'll have to configure PyDev for them otherwise you will get many false error messages due to its lint being unaware of the packages you're importing.
Sneftel
Sneftel
PyDev is quite nice. I've thrown some seriously weird use-cases at it, and it's handled them with aplomb.
smr
smr
I also _strongly_ recommend some sort of unit testing. Python has an integrated unit testing framework, unittest. Not only can it help you write more correct code and help you find regressions, it also can be a decent substitution for a compile step. It will help you find errors that a compiler would normally find without having to actually run your program to find them. I hate nothing more than to have to click through several menus in my application, enter some data, click some more before I discover some silly issue that I normally would have seen when trying to compile.

Even if you don't want to go the formalized route of using a unit test framework, at least give your modules an if __name__ == "__main__" section and run them through their paces. It'll save you time, guaranteed.
Structural
Structural
Thank you for your recommendations.
I'm now trying out PyScripter and I'm going to try out Komodo and PyDev later. I'm not going to use WingIDE because it's not free, and IronPython is not an option (for now) because there are some legacy scripts and it's going to be hard to convince my team lead to invest time in moving to the .NET platform.
STOP THE PLANET!! I WANT TO GET OFF!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.