Python Development Environments? 87
baxissimo asks: "I've played around with
Python a bit, and as a scripting language I quite like it. So I sat down the other day to see if I could use it to make a modest OpenGL/GUI application on Windows. The short story is I gave up. I couldn't get the
Python IDE I had to run--but that didn't stop me. At first I just shrugged my shoulders and said to myself 'Ah, who needs it? I've got emacs,' and then proceeded to waste a few hours trying to cobble together an app that would run before it dawned on me that Python without a decent IDE is definitely not easier to use than C++ with
an IDE. So is anyone out there actually using Python to make serious apps? What tools are you using?"
"I've heard the
wxPython bindings are nice for the GUI bits, so I downloaded those, and pyOpenGL, and
numPy, and
PIL,
etc. The only recommendation I really saw anywhere for an IDE was for boaConstructor, so I got that. Unfortunately it only spit out a useless error messages on startup and died. What I'd really like to start doing is creating C++/Python hybrids, but given that I was unable to successfully debug a pure Python app, I'm wondering what it's going to be like when my bugs might be in either language. How do people deal with this? What tools help you get the job done? If there's nothing free that works, are there any commercial IDE's worth the money?"
Re:Are you kidding me? (Score:1)
you'll likely be programming in a handful of different languages. pick one editor (vim || emacs), become a guru in it and you will be able to sling code efficiently in any environment with any language.
Re:Are you kidding me? (Score:1)
the parent above me makes a very valid point however. It is far easier to become well versed in a text editor to code in so you can drop code into any IDE/compiler/etc and just go with it.
In the long run you'll be better off for it
Re:Are you kidding me? (Score:2)
Usually, I used nedit.
Options (Score:5, Informative)
Re:Options (Score:4, Informative)
Re:Options (Score:2, Informative)
Nitpick (Score:3, Funny)
I can't blame the Boa Constructor guys -- if I'd come up with that name, I'd have put together the website first and worried about functionality later, too.
Coding with IDLE (Score:2)
I use Eclipse and Scintilla... (Score:2)
But it's about as useful a recommendation as you'll get from other slashdot readers for your particular question anyway, so I thought I'd throw it at you.
Good luck, let us know how you make out. I've been wanting to get into Python for awhile, but have no real need to fulfill with it, and no time to dabble.
What I really want is an end to end programming solution whic
wxGlade (Score:3, Informative)
I have to admit here that I'm not really an IDE person - I usually prefer vi and the command-line.
I've also had some experience at debugging python/c++ hybrids, but mostly on linux. On linux if you have a problem in the c++ bit you can use gdb/ddd (remember the executable is /usr/bin/python, and when you're in the python interpreter code, nothing will work unless you've compiled python with -g, but I've never found this necessary).
OSA Foundation (Score:2)
wxDesigner works well (Score:3, Informative)
http://xminc.com/linux/wxpython.html
faq.
wxDesigner:
one of the most complete but is closed source commercialware
Somewhat focused on C++ development
I don't like having to use their editor
outputs xml, python, c++, or perl code
Good, cheap, and stable - developed by one of the wxWindows developers.
http://www.roebling.de/
wxGlade:
nice - under development - copies the best features of glade. Easy to use and extend.
Not a full rad - more of a screen drawer.
outputs xml, c++ or python code
nice tutorial
Actively developed
PythonCard:
Nice if you want to make simple quick app.
I find this kind of tool can cause people to put the business logic in the gui though.
Speeds development by simplifying the event model.
Outputs python code
No option for xml output - but this may be coming soon
Actively Developed
XRC:
Simple xml widget editor
PyQT (Score:2, Informative)
However, if easy GUI building is what you are looking for, then i may suggest PyQT. This is the Python binding for the QT toolkit. You can use 'designer' to build your GUI (the XML file) and then the PyQT tools to create Python code.
Easy, fast, clean.
You can find documentation here [opendocs.org]
Then use the editor of your choice for the rest.
You could always try Kdevelop which has support for Python (and QT Python apps).
Re:PyQT (Score:2)
Visual Studio (Score:4, Informative)
Re:Visual Studio (Score:2)
The link you post says that ActiveState Python for
Python (Score:1, Troll)
Otherwise it's just as verbose and irksome as C++. However, C++ is way faster. I find Python to be rather annoying as far as scripting languages go.
For easy GUI development I like FLTK and its Fluid tool, Qt Designer, or just plain Visual Studio (C++, VB, or C#).
Re:Python (Score:2)
And, as I mention every time when a scripting language (or Java) is discussed, you can usually do the same thing in 5 lines of C++ as Python/whatever. You just have to find and download the right library (of which you have a choice unlike with these standard libraries).
Re:Python (Score:2)
void quicksort(int *a, int len){
std::sort(a,a+len);
}
Re:Python (Score:2)
#include <algorithm>
Re:Python (Score:2)
Here's one in 4 lines in Python:
Let's see the corresponding C++ code.
I didn't write this, look up the Python cookbook [activestate.com]
Re:Python (Score:2)
I didn't bother making the point because it isn't specified in the Python language what algorithm is used either.
Re:Python (Score:2)
Re:Python (Score:2)
I don't see how you can make this claim with a straight face. In my experience,
writing Python and writing my C/C++ pseudo-code takes about as much effort.
With Python, that's it--I'm done.
With C/C++, I have to turn the pseudo-code into actual code.
If I need the performance of C/C++, I will still sometimes write it in
Python first to have pseudo-code that I can test before commiting the time
and effort into the C/C++ implementation (assuming I can't get
Re:Python (Score:2)
I have found just the opposite, as I think almost everyone with a reasonable amount of work in both languages has. The original parent discounts garbage collection and built-in libraries, which is on crack, as both of those aid development speed tremendously. He is blowing off the fact that you have to hunt and find the libs you need to speed u
Re:Python (Score:2)
The "writing C modules for the bottleneck sections" is in practice rarely adequate, because in an object oriented world (e.g. python), we may have entire classes that deserve a low level implementation (mat
Re:Python (Score:2, Insightful)
There's no way in heck I can write debugged, full-feature code in C or C++ as fast as I can in Python. Now, if you want it to run really, really fast, well, that's another story...
Re:Python (Score:2)
One of the big problems I've seen is when most of the code you are using is in a C python module. For instance gtk. What happens then is that the C interface is much better documented, and often better designed (going from gtk1.2 to gtk2.0 in python was a much bigger change than for C code).
And on top of all that, if you screw anything up the C c
Re:Python (Score:2)
You're trying really hard to be wrong, aren't you ?
(1) more runtime flexibility is potentially a huge advantage. Try doing something like eval in C++. Or try typing code directly into the compiler.
(2) python doesn't use gc by default, it uses reference
Re:Close (Score:1)
Re:Python (Score:2)
Ha! No one who has done any CORBA work with both of them can say that with a straight face. Python's CORBA bindings are far simpler than those for C++. And that is all due to the nature of those two languages. That same nature is reflected in many other programming domains.
I think that Bruce Eckel's commentaries on programming efficiency with C++, Java and Python are right on the money.
This is not to s
Re:Python (Score:1)
Re:Python (Score:2)
Re:Python (Score:2)
I did C++ for years before I switched to Python, and writing the same thing in python takes a third of the lines and is much more readable. If you do hardcore bit banging and pointer arithmatic python takes ten times fewer lines (at the sacrifice of speed). When speed matters I still do that part of the program in C or C++ which is called from python, but I only do it when I have to (premature optimisation is the root of all evil, etc etc).
CPU hours are cheap, developers hours aren't.
Excluding bugs that is (Score:5, Insightful)
I think you might be missing out on some of the most important features of Python (or any decent scripting language these days): it's a high level lanugage, intended to be easier to use than lower-level languages like C/C++. Whining about a lack of GUIs is besides the point.
Once you know Python, and understand some of the GUI toolkits, it's far more productive than C/C++ with similar toolkits. So is Perl, Java, or C# for that matter. It sounds like you don't know Python and related GUI toolkits very well yet, though, which is one place where an IDE can be used to limp along for a while.
In case you haven't noticed, an IDE is really a simple set of tools, which exist for nearly every language already -- though not always packaged together. Get over it: your best toolkits won't come in one package, ever. Any good craftsman will learn to piece together a master's toolkit for any problem set, and use those tools when/where appropriate. IDEs, in general, are the Walmart AllInOne toolkit. Okay if you don't know any better, and the problems are small, but not often suited for anything of scale. Think I'm being a twit? How many IDEs are used in production build environments? (Hint: none)
So back to your baseless productivity point: Python is more productive, in general, than C/C++. This includes GUI work without an IDE, and a lot of server problems that are usually mashed into using C/C++. Why? The language (and libraries) focus on ease of use
GUI work without a GUI builder you say? If it's too tedious for you, then automate it (Python happens to be really handy for that). Most GUIs are built around schemas or specifications anyways -- using a GUI builder only speeds up the tedium (it doesn't solve it). And you'll want to know the GUI toolkit well enough to automate with it anyway (using it in ignorance with a GUI builder is buggy in itself). Don't get me wrong, there are some great GUI builders for Python, but don't rely on it to save you from learning something.
One of the best IDEs I've found (and I've used a lot of IDEs) is the OS, and tangent language tools themselves. For Perl, I use Vi, Gedit, or Textpad for my editor, GladeXML or perl scripts to generate UIs, bash/MakeMaker for my build system, and the other Unix tools to fill in the gaps. I've used some of the Perl IDEs in production environments, and they're all limited somewhere. Don't settle for one tool, as your tools contribute to the quality/quantity of what you produce. You can be in control.
Re:Excluding bugs that is (Score:1)
Yes you are, and no, there are many.
Why is it so many job postings these days require a programmer to be proficient with Visual Studio,
Not to mention that the submitter of this Ask Slashdot may merely be a student wishing to learn more and waste less time typing redundan
Re:Excluding bugs that is (Score:2)
You seriously think production shops use Visual Studio as their production build system? Most shops use it as their editor, and their GUI builder, but production builds usually go t
Re:Excluding bugs that is (Score:2)
Then it's odd that you were just a moment ago woofing mindlessly about how python is "more productive" than "C/C++". There is a reason that both C and C++ (which are not the same language) have been wildly successful -- indeed, the python interpreter you are so enthusiastic about, and many modules written for it are written in C.
It's true that it's easy to throw together a few lines of pytho
Re:Excluding bugs that is (Score:2)
To tie this to the topic: "...that Python withou
Re:Excluding bugs that is (Score:2, Insightful)
The only accurate generalization about programming is that all generalizations are wrong. Python may be more productive than C/C++ for some kinds of application, but certainly not for all of them. C/C++ is not as "forgiving" as Python, but for some applications, that's EXACTLY what you want!
Re:Excluding bugs that is (Score:2)
A few options (Score:4, Informative)
Wing IDE [wingide.com]
Now, you mention you had trouble with boa. You're going to want to get it working unless you want to spend some money, because for $0.00 that's as good as it's going to get. Otherwise the two above are good investments. IIRC Komodo has a free version, but I'm not sure. PythonWorks [pythonware.com] had great potential but it's not being developed any more. It only supported Tkinter anyway.
That's as far as GUI designer support. If you're not having any luck you might want to try wxWorkshop [sourceforge.net]. I've heard some people have luck embedding their dialogs in C++ libraries and binding them to Python programs. YMMV.
If all you want is a good Python editor with debugger support there are a bunch of them out there:
http://drpython.sourceforge.net
http://pype.sourceforge.net/ (more mature)
Personally the best Python-specialized editor I've used is IDLE, though it has no GUI capabilities. IDLE ships with the full Python distribution for Linux and Windows, and it behaves essentially the same in both platforms.
You might also want to check this article [informit.com] out. And of course, the clearing house [wxpython.org].
Re:A few options (Score:1)
Ahh, such is the power of Python development. You can have a usable application (source code editor) in a weekend.
Thank you for pimping it.
Re:A few options (Score:1)
Cheers.
Boa and wxPython (Score:1)
Bull (Score:1)
Well.... (Score:2)
The best python editor that I've found, IMO, is PythonWin IDE (not to be confused with PythonWin, which is a python GUI library for windows). PythonWin IDE comes with Active State Python [activestate.com]. Great for editing your python with good syntax coloring, auto-indent, and code completion. Very stable, good performance.
Oh, I should mention: It's Windows only. Sorry if that locks you out, or anything. I've never tried to run i
boaConstructor Rocks (Score:5, Interesting)
That said, the wx toolkit and boaConstructor are _very_ powerful. Have you sent your 'meaningless error message' to anyone on the boaConstructor lists to get feedback? I'm pretty sure the error means something to someone - heck, even _I_ might know what the problem is.
Honestly, and I'm not trying to be a troll here, how do you get anything done as a developer if you give up every time you get an error message? I'm not saying that you should have to debug everyone else's code as a part of day-to-day work, but if you just give up on something (boaConstructor) without Googling for an answer or consulting others or just digging in, then that doesn't bode well for what you'll do when you encounter a bug of your own creation. boaConstructor is used by a lot of people, and is under active development - if everyone got the 'meaningless error message' you got when they installed it, then either no one would use it, or it would already of been fixed. The most likely causes for your problem are:
A) You checked out a bad build from CVS (Get another)
B) You don't have the prerequisites installed correctly, or you installed boaConstructor incorrectly
C) Your Path is messed up (this will affect any/all dev projects - if a library or file cant be found, errors will happen)
D) Invalid permissions
E) Version conflicts (You could be on an old redhat box with Python 1.5.2, and boaConstructor needs a newer version, for example).
Instead of bothering slashdot with this issue, why didn't you post to the python list and/or the boaConstructor list? I'm sure that with the proper info people will be able to solve your problem.
Did you RTFM? (Score:2, Informative)
Did you install wxPython before BoaConstructor? I have installed BoaConstructor successfully. BoaConstructor has prerequisites that don't come in the install package. Look at the install docs agains and figure it out. Once you figure it out write an installer helper program for BoaConstructor in Python and open source it.
Re:Did you RTFM? (Score:2)
Yup. I have installed BoaConstructor successfully. BoaConstructor has prerequisites that don't come in the install package.
Yup. Specifically:
Re:Did you RTFM? (Score:2)
It would help a lot if the install docs mentioned the global name 'wx' not to mention its meaning... wxPython changed its architecture in version 2.5, dropping the wx prefix. Check the migration guide [wxpython.org]. Boa Constructor apparently relies on an older version, install it.
Re:Did you RTFM? (Score:2)
Seems that the Boa Constructor team hasn't discovered that the world has moved on...
I'll try that. Thanks for clueing me in :-)
Komodo (Score:2)
So, if you think you could afford it, it's definitely worth a look. It doesn't have any GUI designing tools, but it does have project management and an integrated debugger.
Hahahahahahahaha ... (Score:3, Insightful)
Unless you're using some subscription release of Visual Studio, VS doesn't even support visual GUI widgets via C++ yet. You've got to use VB, or C#, or J# or some other freakin' sharp to get that.
I think one of the primay points of using a scripting language, bud, is to *get away* from IDE's. IDE's are there because certain large languages and frameworks, or certain requirements for memory management or debugging, are so complicated that using an IDE is a productivity booster. But with Perl or Python, an IDE frequently gets in the way.
Also, if you are building a "modest OpenGL/GUI" app on Windows, well
Or, sit down and learn wxPython [wxpython.org], which has OpenGL support and, dude, is as easy to learn as a GUI toolkit gets. I mean, I'm sorry, but if you have a hard time getting around wxPython, then maybe GUI development just isn't for you. Or maybe you need to be a bit more patient and get out of that Visual Basic mind-mode.
Anyway, it might not be a bad idea to get away from IDE a little. Cutting a little code without IntelliSense, or whatever the hell it's called, might put your mind to thinking about *why and how* things are working the way they are, instead of satisfying the requirements of the pop-up window telling you that you need to supply some widget reference.
For GUIs (Score:1)
Define IDE (Score:1)
I'm a big fan of IDLE, myself. It's by no means the slickest IDE out there or even the best tool for some jobs. However, it does (I)ntegrate a syntax-highlighting, auto-indenting editor; a debugger, class browser, and an interactive python shell. The interactive shell is really the most powerful. From the shell, you can inspect your whole program at any point in its execution
K.I.S.S. (Score:1)
Re:K.I.S.S. (Score:2)
Going without these features is just folly.
GUI Development with Python (Score:1)
Problem: Python is a weakly typed language (Score:2)
Python can never have serious IDE in the same way C, C++, Java, and C# can. There are several Python editors that do pretty syntax highlighting, and maybe some visual GUI editors that generate Python code. Some editors even support parameter or documentation tooltips, but the gap remains when you want attribute completion that allows a level of unobtrusive API exploration while programming.
The problem is that any object can have any other number of properties appended onto it anywhere in the code. Even
Re:Problem: Python is a weakly typed language (Score:1)
What's wrong with that? It's a dynamic language, the IDE can do load and interpret the code as you write it, meaning that the full run-time environment (as much as you've written) is avavilable to the IDE. If you want to write a bit that depends on previous execution of other code, get the interpreter to interpret that bit, then write your code.
Eg.
f() creates a class and returns the cl
Re:Problem: Python is a weakly typed language (Score:2)
That only works if you are there is a route to the function you intend to edit. Any branch can change the list of available properties. Or worse (for the IDE trying to list an object's
Re:Problem: Python is a weakly typed language (Score:2)
many things I like about python, but dynamically declared variables and lack of proper lexical scoping are gigantic detractions.
Python is not weakly typed. (Score:1)
What python is is dynamically typed. That is, a name can be rebound to a different object whose type may differ from the original value.
See http://kahakai.sourceforge.net/wiki/index.php/Weak lyTyped for perhaps a more clear explaination of the difference.
Re:Python is not weakly typed. (Score:2)
As the AC [slashdot.org] pointed out, this still leaves the IDE clueless with respect to completion and correction of method arguments.
Anm
Are you a serious coder? (Score:2)