Domain: wxpython.org
Stories and comments across the archive that link to wxpython.org.
Comments · 63
-
Re:Enjoy years of splitting between 5 and 6
Although Python 3 is objectively better in many ways, the improvements don't seem compelling enough to me to bother to really learn
Well, that is catch-22 in action -- you will probably not really get the improvements unless you actually explore them. If reading about the changes is not enough (though perhaps it is, but you have not read enough), and all the Python developers saying "you should really go to Python 3" is not enough, then perhaps the only thing that will convince you is diving in and experiencing the differences on a deeper level.
For me, as someone who has not grown up in an unambiguous ASCII-society and has felt the pains of handling input in strange encodings, the improved Python 3 string handling is a killer feature on its own. I will not look back.
There are two libraries holding back some of my projects: wxPython (where a Python 3 rewrite is under way) and MySQLdb (a Python 3 rewrite was under way, but has been dead since 2012; today there are several options, though). Those projects stay in the "if it aint broke"-pile until further notice. Other than those (well, only wxPython, really), I have no gripes about missing modules any longer.
And I still kindda like "print" as a statement.
That is probably the most superficial change of them all, fixable by search-and-replace, yet the one that people get stuck on
:-) . It makes a lot more sense to have the parenthesized form, immediately allowing automatic string continuation over lines, optional keyword arguments (end='' is quite useful), etc. -
Re:Does anyone really use it?
That's the C++ API. Which is completely and utterly irrelevant if you are developing in Python rather than C++.
wxPython API has its own flaws, which are just as huge. For example, event handling via message maps, which is directly ported from the C++ API (which in turn got it from the abomination that is MFC). I mean, seriously, this isn't idiomatic Python:
ID_EXIT=110
filemenu= wx.Menu()
filemenu.Append(ID_EXIT,"Exit", "Terminate the program")
wx.EVT_MENU(self, ID_EXIT, OnExit)A numeric "ID_EXIT" in a supposedly object-oriented framework - WTF?
Meanwhile, in PyGTK, it's all just objects as it should be, with no manually defined numeric IDs:
file = gtk.Menu()
file_exit = gtk.MenuItem("Exit")
file_exit.connect("activate", OnExit)
file.append(file_exit)And PyQt is even better:
file = QtGui.QMenu()
file_exit = QtGui.QMenuItem("Exit")
file_exit.triggered.connect(OnExit)
file.addAction(file_exit) -
misc comments on comments
One recent thread about the book (which also comments on why things like functions and OOP appear later in the book than one would think):
http://groups.google.com/group/comp.lang.python/br owse_thread/thread/b8366618c4547978
Also check the Amazon page for reviews and other feedback plus the author even posted a comment:
http://amazon.com/o/ASIN/0132269937
To reply to some previous comments:
- It's *much* faster than it used to be: http://shootout.alioth.debian.org/gp4/python.php
- The indentation only bothers you for 1-4 months. (I didn't like it either at first.)
- It *is* interpreted but byte-compiled like Java to make successive runs faster
- Why ESR likes Python: http://www.linuxjournal.com/article/3882
- Native look-n-feel GUI: http://wxwidgets.org/ and http://wxpython.org/
- Compare to other languages: http://wiki.python.org/moin/LanguageComparisons
- Shopping: http://www.bestbookdeal.com/book/compare/013226993 7 (it seems like Amazon, Buy.com, Bookpool, and Overstock rotate for having best overall price, i.e., no tax [depending on where you live] and free shipping)
- Bad code: Python is attractive to first-time programmers because of its ease, so that's what you may be seeing. Also, bad code is language-independent, regardless; Python does not go out of its way to make this happen. However, Python also attracts long-time programmers because they discover they are more efficient and productive in it.
FWIW, I switched to Python a few years ago (after lots of C/C++, Java, Perl, Tcl, etc.), and I don't want to program in anything else again. The naysayers can pound on me all they like, but from my point of view, I enjoy what I do, I get decent pay, and I can get home on time to feed my kids then hack some more for fun after putting them to bed.
-A.C. -
Re:portable gui
I happen to use Linux, OSX and Windows, and the number one annoyance for me is a lack of clear "native-looking" GUI or OpenGL toolkit offering that is reachable by scripting languages like Perl and Python.
wxPython is native on X11, Windows and Mac OS X.
I used PyOpenGL a few years ago and it was a very pleasant experience. It was easy to translate C examples to Python, without all the annoyances of using C. Obviously you wouldn't want to write a full game engine using Python, but it is nice for experimenting with OpenGL. -
Re:portable gui
-
WxPython
anyone using wxpython will need to upgrade to wxpython for python 2.5
http://www.wxpython.org/download.php
as soon as i'd installed python 2.5 all my app died, took me a few mins
to realise that py2.5 breaks wxpython for py2.4, and some tk demo's ran:) -
The book talks about ...
... wxPython, "a blending of the wxWidgets C++ class library with the Python programming language". Please, do not forget to put links on the articles, because the
/. effect need'em. -
This is a Java problem not an OSS problem
They settled on Java, not an environment I like, and SQL database, a reasonable proposition. So far so good. But over the next few months I noticed that they were spending a lot of time solving problems that didn't really need to be solved. For example, we wanted SchoolTool to be cross-platform. They invested a huge amount of effort designing an XML-based UI description system, which would then automatically generate a UI for each platform. Why reinvent XUL, I asked?
That's classic Java twattery. "Well we didn't build your web application but we did come up with this AOP-maven-driven-frameworky thing which we'll be presenting at JavaOne".
This was 2003. In 2006 this type of project spec is best given to a team that knows wxPython.
-
Just let time pass...
And have Microsoft realize their empire on software development is no more. Right now we have enough development tools available or in progress:
MONO (alternative for .NET),
Gambas (alternative for Visual Basic - linux only tho),
KDevelop (for C++ under Linux),
Code::Blocks (for C++ under Windows),
wxPython, DABO (Foxpro alternative, uses wxPython)...
Soon Bill Gates won't have to worry about people stealing his development tools... because NOBODY WILL USE THEM! X-D -
WxPython or Delphi
I'm a Delphi programmer so I'd suggest you to use DELPHI, but you could give WxPyhon (http://www.wxpython.org/) a try!
:-) -
Re:ya..Verry impressive and all...
see :
http://wxpython.org/
it's even cross platform -
Re:Hype?
Head over to www.wxpython.org for an alternative to tkinter that uses native widgets on each platform.
As far as I can tell, wxpython is the most popular GUI package for python (even though tkinter is the official one). -
Re:I love Python, but...
-
Depends on what you want to do
My goals are pretty simple: I want to write applications that have a great look & feel that will primarily be pulling information from the web (think weather & news), play with that information and present it in interesting ways. I'd like those applications to be usable on the Linux and perhaps Mac OS X platforms.
In that case I'd recommend something like python combined with some gui toolkit such as wxpython or pygtk. ...into the guts of the machine
Since you're on some unix-like system, you could do worse than plain C and a few books (C:ARM5 by Harbison & Steel and Advanced Programming in the Unix environment by Stevens spring to mind). Some asm knowledge might be useful too.
As for tools, frameworks etc. there is of course an unending list of those. For an IDE, a like emacs code browser. -
wxPython
You should try using wxPython. Python is terrific for fast prototyping. Hell, I'm still using the prototypes I've developed.
-
Re:Cross-Platform DevelopmentBecause all mainstream personal computers will use the same x86 processor in the next two years, certain programmers who deal with assembly issues will be relieved. However, we still have Carbon/Cocoa, Win32, and GTK/QT/POSIX to deal with.
Only if you want to deal with all that.
:) If you'd rather not, you could use wxWidgets (or wxPython) which give you cross-platform native interfaces without doing theming and emulation. I think those who want to do cross-platform have it pretty good these days (although it can always, of course, be better).As for the Intel announcement, I think the only real impact will be the first thing I heard of when I read it - speed boost for MacTel apps! (if you can afford it, that is...)
-
Re:consider Python
Python is a wonderful language, not only for beginners, but very much for them, too. It is syntactically and conceptually clean and provides libraries to achieve most of what anyone needs - maybe with some additional downloads like wxPython
;-)Clean, simple, rich, powerful, open source, adaptive to the max, with a huge user community and good documentation.
Python provides a smooth introduction and growth pad into programming and OO.
And if you want to go more advanced try developing component-based web applications with Zope 3
-
Python + Win32 + PIL
(1) Get over Macs. They're really not that great. For people who do work on their computer, applications are more important than the OS.
(2) Use Python with the Win32 extensions if you have to do anything special.
(3) Use the Python Image Library (PIL) for the graphics manipulation.
(4) Use wxPython for the user interface.
If you're careful you can make a platform-neutral solution that will work on Macs, Linux and Windows. So you can use your precious little brain filled with zelotry and illogical xenophobia to work on a Macs then deploy to Windows. -
Re:Take a look @ WxWidgets as well.Start with simple applications first. Copy example code liberally. Learn about model view controller styles of making graphical applications.
C++ knowledge will help, but most good GUI architectures clean up after them selves. I.e. you give an object to it's parent and when the parent is destroyed the object you gave is destroyed as well.
The hardest thing about most gui apps is layout's, you can alleviate a lot of your issues by using wxGlade to design you application and make the stubs. You will have something that works right off the bat to see if you like the interface before you add the logic.
wx will most likely be fine, just make sure you try the app on all platforms you want to ship with. For really fast design, use wxPython, you'll be surprised how easy it can be.
good luck!
-
wxWindows
I ported a Win32 MFC app which graphed a heartbeat line for a particular metric to wxPython http://wxpython.org/ recently and it's worked out great. It now works on Win32 (nicely wrapped up using py2exe and Nullsoft Installer) as well as any Linux system with the wxWindows libs installed. It was even easy to make a simple curses interface for the hard-core command liners. Our ops team has modifed the code now to measure and graph all kinds of metrics, all of which are multi-platform and don't require compilation via Visual Studio. Highly recommended.
-
Re:Don't want to troll, but... where's the RAD?C'mon guys, where's the RAD for Linux?
-
Re:Aha! Interoperability!
write once, compile thrice, and run everywhere!!!
Write once, don't compile, run everywhere.
http://www.wxpython.org/ -
Re:Use a toolkit
Yes, there are some excellent ones too. WxPython is especially good:
Also a simpler toolkit to use that sits on top of WxPython is Python Card:
And if you are into GUI builder kits try WxGlade:
-
Re:Learn Python instead.
I agree with the parent post. If you want to learn a powerful, interpreted, object-oriented, easy-to-use programming language, then choose Python.
I would suggest that you use wxPython instead of Pythonwin though. Apps written with wxPython look like native Windows applications, but have the added advantage of being compatible with other operating systems too. -
My take on the underrated ;)
Robin Dunn, head of wxpython
Neil Hodgson, head of Scintilla/SciTE project
and
Bram Cohen creator of the BitTorent -
Re:Python vs Java
Python, on the other hand, simply works. Sure, it doesn't have a standard GUI toolkit (although wxPython is pretty much the de facto standard now...), but it does everything I need it to do.
Actually, it's Tkinter, if only because it has been packaged with Python for a long time (since the beginning?). However, wxPython is very popular, and tends to look much better cross-platform as it uses native controls. -
Re:Why should "cross platform" always mean Java/.NThis is pure ignorance. The differences between programming languages and scripting languages are completely in the eyes of the developer. Python has excellent tools for developing solid applications which perform well and make use of libraries normally associate with C/C++ applications:
- A large standard library that rivals "programming" languages like Java
- Hooks into popular interface libraries
- for developing GUI applications
- A JIT optimizing compiler for speeding up interpreted bytecode to near-directly compiled code speeds
- Great support for regression/unit testing by allowing "main" functions to be used in every script/class file in large projects
In short, Python can do pretty much anything Java or Mono is likely able to do. In addition, it's faster and easier to code in than most "programming" languages, largely due to dynamic variable typing.
For developer friendliness Mono and Java are a step up from C/C++, but languages like Python (and probably Ruby, though I haven't used it) have potential to be even more.
-
Re:Did you RTFM?Look at the install docs agains and figure it out.
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. Boa Constructor apparently relies on an older version, install it.
-
Hahahahahahahaha ...
Cool. C++, with a link to Visual Studio, is easier than Python.
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 ... why? If you're building something that uses extensive GUI on Windows, why not use Windows Forms or, hell, win32? Try using GLUT for Win32 to complement that.
Or, sit down and learn wxPython, 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. -
A few optionsKomodo
Wing IDE
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 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. 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 out. And of course, the clearing house.
-
Python ResourcesPython is an ideal language for hacking in - I completely agree with your points about it being easy to pick up - and easy to pick up your own code again after a month or two away from it. Here's a handy list that I have prepared for whenever somebody mentions Python in a context like this one:
Python Resources
This is a list of what I consider to be the most useful Python packages. They give Python the ability to tackle almost any project.
Core packages- Python - Get the Python interpreter, base libraries from here. The default install includes the IDLE editor.
- Win32All - Windows extensions package that includes the excellent Pythonwin editor.
- wxPython - Wrapper to the cross-platform wxWindows window manager library. It's a better windowing system than the TCL/TK library that is the default Python install.
- Boa Constructor - GUI builder that uses the wxWindows library.
- Psyco - x86 runtime compiler. Transparently improves the performance of most Python code - for performance-critical apps, it's often a much better solution than a C rewrite.
- Py2Exe - Builds Python scripts into Windows executables. Perfect for distributing programs to systems that do not have Python installed. Use with Psyco for the best effect.
- PyOpenGL - Use OpenGL from within Python
- Python Image Library (PIL) - Package for easy image loading and manipulation
- PostGreSQL - Full-function SQL database. More complete and advanced than MySQL.
- PyGreSQL - Python bindings for the PostGreSQL database.
Python includes a full suite of functionality to build internet applications in the core install, but the following are frameworks for building and deploying web applications. -
Re:Let Me Get This Straight
such as JDBC drivers, XML parsers, SOAP tools and 3rd party components
Semi-check, built-in, check, and check (including a lot of real winners, particularly including multiple cross-platform GUIs).
(The semi-check is because I'm not 100% certain the python modules match the JDBC completely.)
The only advantage Java offers is when it has an actual library that you can't get in Python (or likely anywhere else); capability for capability the languages and libraries are pretty close to the same. I mean, we have "Web Application Servers" for Python (like Zope), but maybe you absolutely need some Java thing for some other reason. There's no one language that meets all needs. But there's no reason Python can't be used in very large scale projects successfully, as evidenced by the fact that it has been so used.
Personally, I'd much rather use Python for the larger scale projects since for a variety of reasons I think it scales better then Java; Java projects IMHO survive because they get a lot more resources thrown at them, not because the language does very much to hold large projects together. But that's just my opinion.
(Oh, and Jython, though I know it's been mentioned elsewhere.) -
Python Resources.This is a list of what I consider to be the most useful Python packages. They give Python the ability to tackle almost any project.
- Python - Get the Python interpreter, base libraries from here. The default install includes the IDLE editor.
- Win32All - Windows extensions package that includes the excellent Pythonwin editor.
- wxPython - Wrapper to the cross-platform wxWindows window manager library. It's a better windowing system than the TCL/TK library that is the default Python install.
- Boa Constructor - GUI builder that uses the wxWindows library.
- Psyco - x86 runtime compiler. Transparently improves the performance of most Python code - for performance-critical apps, it's often a much better solution than a C rewrite.
- Py2Exe - Builds Python scripts into Windows executables. Perfect for distributing programs to systems that do not have Python installed. Use with Psyco for the best effect.
- PyOpenGL - Use OpenGL from within Python
- Python Image Library (PIL) - Package for easy image loading and manipulation
- Plone - Web applications, built on top of the Zope framework.
Abandon Perl! Python is the future! -
Re:Language-Neutral GUI
-
Re:Personally I like wxWindows
Don't forget wxPython, the mature and actively maintained Python binding. It makes GUI programming such a piece of cake.
-
Re:Personally I like wxWindows
-
Silly trolling article writer.One drawback sometime cited is its relatively slow execution speed compared to compiled languages such as C.
A mention of the Psyco Python runtime compiler is in order. It's simple to use as well - all you do is put this at the top of your entry script:import psyco
All routines called are then compiled from bytecode on-the-fly into native x86 code. It's not quite as fast as C - but with Psyco you can easily get close, especially if you design your algorithms properly.
psyco.full()
While I'm here, these are the Python packages that I find essential once I have the base installation (which includes the IDLE IDE). I've used these packages under Windows, but most work on Linux as well:- Win32All - Windows 32 extensions & the Pythonwin IDE
- wxPython - A GUI library based on wxWindows. Far superior to the included TCL/TK libraries.
- Psyco - Runtime compiler, mentioned above
- Py2Exe - Takes in Python scripts, spits out executables (note: use in conjunction with Psyco for best effect)
- Boa Constructor - A wxWindows GUI design tool. It's a full blown IDE as well, but I have only used it to design GUI layouts, I code in Pythonwin.
-
Re:Obsolete?
Eh? Perl/Tk, Python/Tk and (let us not forget) Tcl/Tk are obsolete? Not dead yet, I'd say, although perhaps GTK+ is starting to replace it in favor. What say you?
...
Anyone got a graphics API they want rendered obsolete? I'll just go study up on it, that should do it...)
In the Python world at least, wxPython is gaining ground on Python/Tk. I used to used Tcl/Tk, then dropped the Tcl, now I've dropped the Tk. Please don't look at though ;)
-
Re:moving towards bloatware or are these important
It sounds like it's moving towards Python with the addition of Lisp-ish functions and itterators.
Any programmers looking at C#, I recommend also checking out Python, it is a wonderful language. Particularly with Win32 extensions (Windows-specific extensions, but most useful feature is an amazing editor / debugger, Pythonwin) Psyco runtime compiler and wxPython for cross-platform GUI building. -
Re:Python - Python in a nutshell
That's because you should rather use wxPython Try it and see...
-
Re:hogwash.
Seriously, what alternatives to QT do you suggest? If you need something with a configurable look, looks sort of like native Windows apps on Windows, is supported on Linux, OS X, Windows and Solaris, and is fairly mature and stable.
wxWindows is better than Qt because it uses native widgets on all platforms, not emulated native widgets like Qt. It is mature and entirely free. There is also wxPython, letting you use wxWindows in Python. -
Similar thoughts as I start a projectWith regards to the C/C++ point and the documentation point in the article...
I'm working on a project for central user management on a popular network appliance. At present there's only one commercial solution (that I could find/google) available that lets you manage n+1 of these appliances at once.
I initially looked at the problem and figured, heck I can do it easily with expect and ssh, but then I started thinking about how my employers & co-workers would use it (I contract), and realised a command-line application wouldn't suffice.
So I started pondering how I could integrate a fairly simple backend (that could be implemented by scripting languages) with a portable interface.
I could either:
- a) Put the backend script onto a webserver, and allow administrators to use it via a web browser and CGI.
- b) Use Python and wxPython to provide a GUI application that runs on windows/unix/mac.
- c) Use Tcl/Tk to provide a GUI application that runs on windows/unix/mac.
I eventually chose the tcl/tk option, because of the following reasons:
- 1. A webserver-based application would require ongoing maintenance of either a new server, or speaking with existing server ops to get our stuff onto their boxes. This didn't fit in with timeframe and would be difficult to maintain and distribute updates.
- 2. wxPython lacks extensive documentation. I'm not going to force myself to join mailing lists and peruse demo code to figure out how it all works.
- 3. Tcl/Tk is well-tested, instantly portable, and documented up the wazoo.
So I ended up choosing a well-documented language for implementation, which has the benefits of being portable, interepeted (no compiling), and easily updateable (email the latest script). Sure it isn't the sexiest solution, but it works and is easy for new developers (the project will be open-sourced when ready) to pick up on where its at.
-
widget set...Grrr,
They're using some strange ugly wxpython (http://www.wxpython.org/screenshots.php) widget set... why not gtk2? It looks so much better (not to mention integration with themes and gnome), it's also cross platform.
I know it's only 0.1 but the ui is very ugly, the ions and buttons need to be cleaned up and spaced out.
These UI things may sound trivial but ugly, difficult-to-use programs will not be adopted by the masses.
I do hope these things are sorted out, I'm rather disappointed.
-
Re:the return of "worse is better"And for the record, the only way to do graphics in PERL is by using Tcl's TK API. (Same for Python.)
For the record, you're wrong.
Please look at wxPython and Perl's entire user interface section of CPAN.
Please do the tiniest bit of research before you post. It would have been enough.
-
Re:wxWindowsBoth packages all but force the programmer to reuse the library with inheritance.
Erm, take another look at this wxLua example. No inheritance in sight. The choice to force the use of inheritance in wxPython was a design decision.
What I'd rather have is a wxPython/wxWindows interface that can be used to construct a GUI thru composition.
wxWindows already has layout management, and based on this wxPython example, it's already part of wxPython. It shouldn't be too hard to write a class that automate this to the degree you want.
-
Re:wxWindowsThis is an issues with how wxPython has been developed, not with the wxWindows library itself. I've written a (still alpha) small scripting language that uses dynamic callbacks instead of inheritance. It's fairly painless to Connect objects to callbacks.
That's not to say anything bad about wxPython itself - it's just a matter of style.
You might want to have a look at wxLua, a nice mixture of Lua and wxWindows.
-
wxWindows / wxPython
Robin Dunn, founder & maintainer of wxPython, an excellent Python-Wrapper around wxWindows, anounced in the wxpython-mailinglist that he was contracted by OSAF.
And who ever has enjoyed wxPython and the excellent support of Robin in the mailinglist knows: he get's things done. Or dunn.
So... if they don't succeed in travelling to space, at least teflon will be available. -
Re:I've done this!
The problem with Python is that its GUI features are not fully cross-platform yet.
Not true: wxPython. Sure, it doesn't come bundled with official Python distributions, but wxPython is cross-platform and quite capable, and blows the socks off Tk. -
wxPython!If you like wxWindows, you'll positively wet yourself over wxPython! (Ain't SWIG grand?) Can't wait for an embedded flavor of this!
Yes, you can finally fling that VB reference manual into the river. There, it sits, until it's find by the most unlikely creature... "Precious.... precious!"... ooops. Sorry.
-
Re:WxWindows
Their main public relations problem seems to be the use of an adult language, C++
Actually, I might argue with you that C++ might more apppropriately be called a geriatric language in a general programming context, but that would start a holy war, now wouldn't it :)
However, for those of us who like to use slightly quicker to code languages for some of our projects, WxPython provides a Python wrapper around WxWindows. And there is a Perl wrapper out there as well, tho I have never used it.
Combine this with Pippy a PalmOS Python implementation, and you have lots of Py goodness for Palm devices.