Slashdot Mirror


Generic GUI Wrapper For Python

An Anonymous Coward writes "IBM is working on a generic GUI wrapper to allow Python developers to write cross-platform GUIs. The anygui project will expose a common set of functions to the programmer and choose which backend gui toolkit to use for the given platform: TK, WIN32, GTK, Bethon, etc. Currently the software is in an alpha stage. The article also has some example code." Update: 10/27 23:53 GMT by T : Magnus Lie Hetland wrote to point out that though this article is hosted at IBM, "Anygui has nothing to do with IBM. It is, in fact, an independent Open Source project currently hosted at SourceForge."

114 comments

  1. WxPython by redcliffe · · Score: 2, Informative

    What's wrong with WxPython? I've seen software on Linux and Windows that uses that. What is the difference between WxPython and IBM's one?

    David

    1. Re:WxPython by Anonymous Coward · · Score: 0
    2. Re:WxPython by fxj · · Score: 1

      wxPython is great for programming real applications. It now runs on win32, gtk, motif and macos. But on a BeOS box or on a palm or (insert your favourite device here) it is not available. AnyGUI would run on ALL platforms because it uses the already installed GUI.
      Python itself is available for many many platforms: linux, win32, solaris, os/2, amiga, beos, qnx, vms, psion, acorn vxworks, ibm as/400, playstation, palm, winCE
      and you could write a program once and it would use the native GUI on the respective machine.
      cheers

    3. Re:WxPython by Progoth · · Score: 1

      the interesting part about this anygui, and the part that makes me the most skeptical...is that one of their intended targets, along with wxWindows, GTK, mac native, etc...is ncurses. Somehow I just don't believe that they'll be able to write a toolkit so generic so writing a UI that looks fine in GTK looks fine in a console.

    4. Re:WxPython by Anonymous Coward · · Score: 0

      The portability doesn't belong in a pure python module, providing some shit-ass lcd environment across half a dozen work-in-progress toolkits with a whopping handful of gui elements. Ooooh look how professional that is!
      Look how much of a success AWT was, and it had the benefit of only a few backends that were commercially supported.

      No, the proper portability for a toolkit lies in the toolkit itself. If you lack a wxWindows backend, then write a backend for your platform. If you lack a Tk backend, then write one for your platform. If you lack a Gdk backend, then write one. Then what do you get? A toolkit portable for ALL LANGUAGES that will DISPLAY CORRECTLY and HAVE MORE THAN A FEW WIDGETS.

      Even then, this will only be relevant for the subset of projects which will work with a portable toolkit and don't need/want KParts, Bonobo components, COM objects, etc.

  2. This is another prime example of... by Anonymous Coward · · Score: 0

    a Python story about a generic GUI wrapper.

    -Mr. Redundant

  3. What about MacOS X? by Paladeen · · Score: 1

    Well, what about MacOS X?

    Anybody know anything about future Python support for the X as well as this anygui?

    1. Re:What about MacOS X? by Paladeen · · Score: 1

      Many people have stated their desire for a standard Python GUI. Tkinter comes moderately close -- it has stable versions for Windows and UNIX/X Window Sytem, and a passable MacOS version.

      When they say "passable MacOS version", do they mean Classic or MOSX?

    2. Re:What about MacOS X? by Phroggy · · Score: 1

      When they say "passable MacOS version", do they mean Classic or MOSX?

      They mean classic Mac OS. I got TiK to run on it once; here's a screen shot. There seemed to be no support for the menubar, or right-click contextual menus, or of course sound (since I believe TiK cats .au files to /dev/dsp). I'll see if the newer versions run better.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    3. Re:What about MacOS X? by kraftknoedel · · Score: 2, Informative

      AFAIK, there is currently no explicit support for MacOS X.

      If MacOS X has Jython (swing), PyGTK, Tkinter or wxPython it should work out of the box anyway. If not, we would of course welcome a developer of a MacOS X backend!

      Regards,
      Kalle Svensson, PyGTK backend developer.

    4. Re:What about MacOS X? by Progoth · · Score: 1

      I don't know about that....but I once ported a script from Perl Tk to Python tkinter (both on Windows), and it leaked memory hardcore. It was just a little window with 2 scrollboxes and a few buttons, I left it running once overnight and the next day it was using something like 80 megs of ram. Not exactly what I'd call stable anyway...

    5. Re:What about MacOS X? by hobbs · · Score: 1
      Well, what about MacOS X?
      Anybody know anything about future Python support for the X as well as this anygui?

      Tk in 8.4 has a native Aqua port (Oct 16 news) in beta, from the guys at Apple. All languages binding to Tk can take advantage of OS X now.

      In any case, this has been said, but the idea of anygui being the lowest common denominator of toolkits seems like a bad idea being repeated. Tk has been inflicted by this sometimes, but more and more pressure is on Tk development to add more single-platform support bits in the core.

  4. I like this idea. by jellomizer · · Score: 1

    I have been working with Python sience this summer Ranging from Web Apps to console apps. I find it real nice because I dont usually have to annoy the administer to add more modules on to the system (like in perl), Pluse my code comes out really clean and most of the time the programs are cross platform so it makes distribution a lot simpler. And the main reason I usually avoided using graphics in Python is because the GUI interface needed a tcl/tk program and that becomes more of a hasel for distribution. If they can come up for more of a common graphical interface that can be imbedded into the Python source and works platform independent I am all for it.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    1. Re:I like this idea. by Anonymous Coward · · Score: 0

      http://www.wxpython.org

  5. random Java flaming again by mj6798 · · Score: 4, Insightful
    Mertz writes: A popular joke about Java is that it is "write once, debug everywhere."

    Pretty much all the portability problems with AWT came from the use of native widgets. So, why is Mertz going to repeat the same mistake in his implementation? In fact, it looks like he is going to work hard to make things worse by exposing different APIs on different platforms.

    There are a couple of good cross-platform GUIs for Python: FLTK with Python bindings, Fox with Python bindings, and wxWindows (universal or native) with Python bindings. Mertz's project seems like it recreates something whose functionality already exists--a typical case of N.I.H.

    1. Re:random Java flaming again by platypus · · Score: 1

      Did you go to their website?
      As far as I see they just want to create an abstraction layer for the different gui toolkits in python. Even for text and html.
      I think this is very neat and definatly not NIH.

    2. Re:random Java flaming again by GroovBird · · Score: 1

      I think that proves the point of not programming the 'write once run everywhere' style. It's a promise just as RAD is a promise and just as all the CASE tools promise you heaven without sweat.

      You could argue this, and propose to use a 'common widget set' with 'common behaviour' across all platforms, but this will alienate your software's GUI from the rest of the system. As a Windows user, I resent anything that behave's like a Mac or like a Sun, how subtle the differences may be.

      IMHO, true cross-platform development means separating your GUI from your internals, and keeping the functionality platform independent. Ansi C++ for this (including STL) is maybe a good choice, but I'm not a C++ developer.

      Just my 0.02 Euro

      Dave

    3. Re:random Java flaming again by Anonymous Coward · · Score: 0

      Or, "Write once, run away"

    4. Re:random Java flaming again by Anonymous Coward · · Score: 0

      Are you capable of reading? This abstraction will fall equally short as AWT, because these systems have different properties, different widgets, and different event mechanisms.

    5. Re:random Java flaming again by burtonator · · Score: 2

      Pretty much all the portability problems with AWT came from the use of native widgets. So, why is Mertz going to repeat the same mistake in his implementation? In fact, it looks like he is going to work hard to make things worse by exposing different APIs on different platforms.

      The portability problems did come from AWT but not from the use of native widgets.

      The problems arose because SUN kept the Java Development Kit proprietary and refused to fix any bugs in the system.

      I mean AWT still uses Motif on UNIX machines (even to this day)? Motif is very different from the Win32 API so you could easily see why applications written on Windows/UNIX had different "issues".

      These issues will be fixed in GCJ (GNU Compiler for Java). GCJ will provide a modern AWT implementation which should eventually support both GTK and QT.

      Java is back baby! And this time it is Free and GNU powered!

      Kevin
  6. In short, IBM says "Screw you guys, we'll do it." by Nindalf · · Score: 0, Troll

    The problem: existing cross-platform libraries are not ported everywhere.

    The solution, according to IBM: port an existing cross-platform library everywhere? No! Make an entirely brand new cross-platform library interface, that runs no previously-written code. Also, instead of wrapping the few unsupported low-level GUI interfaces not yet supported, and deal with all the quirks of each system, they will wrap every existing Python GUI, and deal with the quirks of each system. Naturally this will result in a far superior, much more portable product. Why? Because We're IBM and We say so! (it's their company motto, slogan, and vision statement, look it up)

    So all Python programmers should immediately embrace this new standard, which, despite being alpha at best, will surely soon be much better than any existing toolkit.

    Sure, they could just clean up the TK ports, but where's the fun (or branding) in that?

  7. awt ? by Anonymous Coward · · Score: 1, Interesting

    "...The emphasis of anygui is to provide a usable set of interface elements that will work with every backend; particular backends might themselves be capable of more advanced interfaces, but anygui sticks to what is common to them all. ..."

    it looks like awt.

    awt was replaced by swing because by sticking with
    lowest common denominator, you end up with just
    very simple (and not very useful) widgets.

    1. Re:awt ? by Anonymous Coward · · Score: 0

      and now Swing is overengineered to such a degree people find it a pain in the ass to code. but you are correct - there is a fine balance (which I believe qt and wx have both struck). the more people who use anygui will be able to throw their votes into the ballot box on what features are needed (especially higher order widgets like tree widgets)

      think, anygui and xforms. python is such a productive language. only if politics didnt exist and programmers didnt have such closed minds.

    2. Re:awt ? by Anonymous Coward · · Score: 0

      Qt doesn't use native widgets at all, it's hardly a "balance" like wxWindows. Qt is simply much better than Swing, because 1) It's not written in Java 2) they don't require you to create classes to handle events 3) it's a lot more likely a compiled C++ program will do better than a Java program on the average person's computer, when they have either an old JVM in their web client or the ass Java Plugin.

  8. Reminds me of my comp sci professor by Anton+Anatopopov · · Score: 1
    Who always used to say there is no problem in Computer Science that can't be solved by adding a layer of indirection :-).

    Someone should try this with perl, it could use a good abstraction layer like this.

  9. it's not an IBM project by mj6798 · · Score: 2

    Mertz's affiliation is given as "Gnosis, Inc.", not IBM. The article is simply published in IBM's DeveloperWorks for Linux.

  10. Re:Mmm by geodude · · Score: 1

    "Perl is worse than Python because people wanted it worse". Larry Wall
    (Creator of Perl), 14 Oct 1998

    source:
    http://www.mindview.net/Books/Python/ThinkingInP yt hon.html

  11. Generic AI Mind Wrapper for Python by Mentifex · · Score: 0, Offtopic

    Python is used for twenty-seven open source AI projects on SourceForge, and therefore a Mind-to-Python liaison page has been established at http://mind.sourceforge.net/python.html -- along with fifteen other Open Source AI languages.

    Artificial Intelligence in Python at http://www.strout.net/python/ai/ is one instance of how important Python is for AI.

    What most open source AI projects lack is a Theory of Mind well-grounded in neuroscience. The http://mind.sourceforge.net/theory5.html page with ample co-references provides not only the fundamental AI theory but also its albeit primitive implementation in both Win32Forth and MSIE JavaScript -- which any AI enthusiast may easily save-to-disk and begin hosting on a personal Web site, as the AI Mind pervades the 'Net and leads us upwards and onwards to Technological Singularity!

    1. Re:Generic AI Mind Wrapper for Python by Tablizer · · Score: 0

      Don't forget what the association with AI did for LISP.

  12. Not IBM... by kraftknoedel · · Score: 5, Informative

    You might be interested to know that this project has nothing to do with IBM. There is an article about it on IBM developerWorks, but that's it.

    Also, it's not David Mertz's project, the project leader is Magnus Lie Hetland.

    More info: http://anygui.sf.net/

    Regards,
    Kalle Svensson, PyGTK backend developer.

  13. Re:Mmm by Anonymous Coward · · Score: 0

    'worse' in this particular case means braindead object design, that's because no perl code ever uses objects that they were implemented in such a bad way, but since no one uses them it doesn't matter, that's where perl is worse. Of course in perl you can put as many spaces as you want without the interpreter complaining about it. On the other hand, most object oriented designs fail, take Gnome as the best example, circular library dependencies anyone? Even with that it has made progress, so much that next Mandrake release will provide in-kernel gnome support. Sure the kernel size will grow to 25MB, but memory is so cheap these days that it won't matter. Now talk about bloated :)

  14. Re:In short, IBM says "Screw you guys, we'll do it by nowt · · Score: 2

    Someone then please explain why pygtk is unsuitable...?

    --
    A strange game. The only winning move is not to play. How about a nice game of chess? - Joshua (Wargames)
  15. seems very naive by jilles · · Score: 3

    SUN has been working for years to create a cross platform application framework. It is called swing. Swing is very complex and heavy on resources but it does the job. It supports printing, drag & drop, integration with the native clipboard, key bindings, skinning, all sorts of graphical stuff and lots of other stuff.

    While you might disagree that Swing is a good solution, the fact remains that Sun realized that all of the above is needed if you want to create competitive GUI apps.

    The solution suggested for python seems to make the same design mistakes sun made early on (AWT) and seems to be based on the same naive view on what comprises a good GUI. In addition it seems to ignore a whole lot of other perfectly good solutions (qt, gtk, XUL, Kylix, Swing, ...). Swing integration is easy if you use jython. I think there are also python bindings for Mozilla so you should be able to create XUL applications in python. Presumably integration with GTK or QT is also easy.

    Wrapping is no good solution for anything but the most trivial applications. As soon as you make things more complex, you will have more and more trouble keeping things crossplatform since each platform works slightly different, has its own bugs to work around and may or may not support what you need.

    --

    Jilles
    1. Re:seems very naive by jas79 · · Score: 1

      did you actually read the article?
      they aren't ignoring qt,gtk,swing and others. they are using them!!
      they are making on unified way to access them from python,so that the user can choose which one he want to use.

    2. Re:seems very naive by Havoc+Pennington · · Score: 2

      Precisely. There is a reason GTK doesn't work like anygui, and a reason Qt/Swing/Mozilla/etc. also don't work like anygui, and a reason the AWT approach was dumped.

      You can do cross-toolkit abstraction if you do it like AbiWord, where they often add features and hooks to punch through to platform-native if required. But that doesn't work in a generic XP toolkit.

      Wrapper toolkits are very limited in power, there's just no way around it.

      Python needs to bite the bullet, suck it up, pick one of the existing actively-maintained modern toolkits despite the possible flamewar, and then simply address its limitations (e.g. porting to platforms as required). Until then it won't have a standard GUI. Sometimes there is no silver bullet. ;-)

    3. Re:seems very naive by Erik+Hollensbe · · Score: 1

      AWT was actually concieved and developed within a month's time, to add extra (and obviously very useful in the java world nowadays) functionality as a GUI. Java was not originally intended to do GUI apps.

      Swing is *really* nice when it comes to cross platform work. It's a very full featured widget set, and writing your own custom widgets for it is very easy, listeners and all.

      And of course, making it work in a 'native' gui ocntext really amounts to what Swing theme you use.. There are generally platform-specific themes in the JRE's for said platform.

      If python really wants it's own GUI abstraction layer, they should really write a real toolkit that doesn't piggyback on the (mal)functionality of the overall GUI world out there.

    4. Re:seems very naive by bssea · · Score: 1

      It's views like yours that hinder learning and research. It's those same views that stop people from making vast breakthroughs that may alter the landscape of their specific field.

      "It can't be done!"
      "It's been tried, and that failed. If they couldn't do it, you can't".
      "That impossible to do."

      Things like what you just said, were said for a multitude of things, (i.e. Nukes, lasers, space flight, UNIX, X, Linux). But guess what, they all happened.

      Will this project change the landscape? No. Will this project alter history? No. Does the possibility exist that this project will force developers to look at their code differently? Yes. That's all that needs to exist to make this project worth while to the developers who choose to develop for it.

      I don't care if you're a "well-known hacker". I don't care that you're the "Chairman for the Gnome Foundation", and, right now, I couldn't care less if AnyGUI went away. For you to completely blow off the whole project just shows me how short-sighted you are.

      This is open-source. You don't like the project, don't use it. Let them do their thing, you go do your thing, and everyone is happy. Maybe within a year or two they, or some other project, will show you up and prove that it can be done.

      And yes, AWT was dumped.. by a corporation who failed to see enough profits to come from their investment. This is not a corporation, they are not driven by their bottom line. You, of all people, should recognize that.

      --sea
    5. Re:seems very naive by Anonymous Coward · · Score: 0
      I would agree if you meant that Swing has a really nice programming model. I haven't done much GUI programming, but compared to Win32 or MFC, Swing is perhaps order(s) of magnitude more transparent. Swing code is actually fairly readable IMHO.

      On the other hand, runtime Swing is still sluggish. JDK 1.3 marked the first revision where Swing performance was "good enough." But that's still a far cry from lightweight and fast (overall). The Swing library is huge and memory-consuming. Considering how little it is used in the context of Java programming, I'd say it shouldn't have been bundled into the JRE/JDK as a standard library, but rather cleanly separated as a standard extension.

      Also, at least on the Linux platform, you still have a situation where Swing apps have various anomalies when you switch between JDKs. Compared to other standard Java libraries that generally run equally well on any given platform, Swing still has subtle issues to detect and debug.

      Finally, pluggable look and feels are a nice feature, but arguably theming should be handled by the native platform (i.e. the window manager). I know AWT was a failure, but in theory, Swing apps ought to look/feel and behave as any other app running on your system. I know this rule somewhat breaks down when you consider that X apps come in many different styles.

    6. Re:seems very naive by elflord · · Score: 1
      It's those same views that stop people from making vast breakthroughs that may alter the landscape of their specific field.

      Nonsense. No-ones trashing "anygui" for being new and challenging conventional wisdom. It's being criticised because it's a rehash of old designs. If there were some evidence that the authors better understood the pitfalls of similar projects (AWT being a good example), and had some plan to address these issues, perhaps the posters here would be less cynical.

      The article trashes java, while failing to point out how "anygui" will avoid the same pitfalls.

      And yes, AWT was dumped.. by a corporation who failed to see enough profits to come from their investment.

      And a corporation who realised that a complete redesign would be a more effective use of limited resources than trying to fix AWT. Or are you trying to argue that Swing was a triumph of marketting over good design ? I think you'd find anyone who'd used both toolkits would find that laughable.

    7. Re:seems very naive by Devil's+Avocado · · Score: 1

      Anyone who says "Why aren't they just using toolkit X" or "They're never going to be able to make animated skinnable toolbars with dancing frogs" is missing the point entirely. Comparing this project to AWT or Swing is missing the point entirely. This team is not reaching for the same goal as the Java team was, i.e. to be a world-class competetive GUI. There are two keywords for this project:

      Minimal: The goal is to have a *minimal* set of widgets that allow the most common types of input and output. The idea is to make a toolkit that anyone can use to create a *simple* gui on any platform that Python runs on.

      Universal: Which one of the "other perfectly good solutions" you mention (qt, gtk, XUL, Kylix, Swing) does *everybody* have? Which of them is available on all the platforms that Python runs on? None of them, of course. The whole point is that no single toolkit is going to satisfy this requirement, so more than one toolkit needs to be supported.

      What most of the posts I've seen so far lack is an understanding of the current situation in Python. The language is great for programming almost any kind of non-realtime project in a cross-platform way, but it lacks a way to write cross-platform guis without asking the user to download a 5 to 10 MB window toolkit on one or more of Python's platforms. This is simply unacceptible when you're distributing a 150 kB Python program! Hell, it's hard enough to get people to download the python interpreter!

      There is a real need for this project in the Python community, and I wish them great success.

      -DA

    8. Re:seems very naive by jilles · · Score: 2

      I mostly agree with you actually. I just don't agree that the solution should aim for a minimal set of features that is common to all platforms since I strongly suspect that just like with AWT it will be an ugly mess. AWT provided just the basic features. You could instantiate a button, put it in a window and so on. However, even this simple functionality was too different from platform to platform which resulted in applications that had to be tested on each intended target platform to deal with all the platform specific quirks.

      I agree however that there is a need for a crossplatform GUI kit. I only think that it should be a full featured one rather than some arbitrary subset. More importantly, I think it should be object oriented and language independent. Otherwise we'll see duplicated efforts for perl, ruby, whatever. Most of the existing GUI kits are language dependent or at least assume a great deal about the language used to work with them. This limits their usefulness. A good example is the GTK - QT debate. C programmers will likely favour GTK whereas C++ programmers will likely prefer QT. Swing is great when you use Java, but using it from another language is usually hard (unless it has an implementation ontop of the JVM).

      --

      Jilles
    9. Re:seems very naive by SEE · · Score: 2

      Which one of the "other perfectly good solutions" you mention (qt, gtk, XUL, Kylix, Swing) . . . is available on all the platforms that Python runs on?

      First, I admit that XUL isn't exactly ideal for the kind of work he wants to do.

      But, as far as platform availability, XUL already works under seven different GUIs (Win32, BeOS, MacOS, WPS [OS/2], X, Photon, and NanoGUI) and at least nineteen operating systems (Windows 9x/Me, Windows NT/2000/XP, MacOS, MacOS X, Linux, AIX, BeOS, Irix, OpenVMS, OS/2, HPUX, BSD/OS, Solaris, Tru64 Unix, FreeBSD, NetBSD, DG/UX, and QNX).

      Okay, admittedly the DG/UX binaries are rather old, and the Photon/QNX ones might be (I can't find any data on whether recent milestones are available for it). But everything else on my list has a Mozilla 0.9.4 or 0.9.5 version.

  16. This is not a new GUI toolkit by richw · · Score: 4, Informative

    Most of the posts so far seem to have missed the point.

    This is not a new GUI toolkit. It is a wrapper API for a large number of underlying graphic toolkits. You write code for AnyGUI and don't have to worry what GUI toolkit is used. "On Windows, the Win32 API might be used (or wxWindows); on MacOS, native calls; on BeOS, Bethon; on Linux, TKinter or GTK"

    Also, as far as I know this is not an IBM project. The article is just published on an IBM site.

    If this works as well as the AnyDBM module which allows basic database access from Python without having to worry about what actual database you are using it will be great.

    Check out http://anygui.sourceforge.net/

  17. Re:In short, IBM says "Screw you guys, we'll do it by Anonymous Coward · · Score: 0

    Because GTK sucks ass.

  18. Won't work by edLin · · Score: 1

    If it did work, somebody would have done it by now.
    Java tried it, failed.
    Netscape tried, failed.

    1. Re:Won't work by bssea · · Score: 1

      hmm, that sounds familiar... where have I heard that statement before? Oh yeah, from Microsoft(about Linux), for C++ developers(about Java), and from just about every other nay-sayer who thinks that a tool can't be made, or won't work. Television, radio, electricity, and the telephone come to mind.


      Let them try. You don't like the project, don't use it. Much like if you don't like KDE, don't use it.


      I'm tired of people like you. If a developer chooses to develop for a project, then that developer thinks it can be done. And the opinions from the likes of you shouldn't stop them. God knows where the world would be if everyone listens to opinions like that.



      --sea

    2. Re:Won't work by edLin · · Score: 1

      I did not say don't try.
      Just said it won't work.

      PS - WTF is this:

      Slashdot requires you to wait 20 seconds between hitting 'reply' and submitting a comment.

      It's been 15 seconds since you hit 'reply'!

    3. Re:Won't work by Anonymous Coward · · Score: 0
      I essentially agree with your sentiment here. While I don't hold much hope for the project, who am I to tell the developers that they shouldn't do it ? No one has the authority to do that, and no-one should.

      On the other hand, I think I have the right to give my $0.02 on slasdot.org. (-;

      BTW, this is not at all like java vs C++ or Microsoft vs Linux, so I won't even address these worthless and irrelevant analogies.

    4. Re:Won't work by lha2 · · Score: 1

      Looks like an attempt to prevent half-thought out posts.

      Good luck, slashdot!

  19. My faith in Anonymous Coward is broken forever! by Nindalf · · Score: 1

    That's... a good point. I read it as a somewhat odd press release, and skimmed right over the header material to read the body.

    It changes the tone of the article completely, from giant nonsensical arrogant corporate initiative to just another cross-platform GUI library for Python.

    Wow, I'm dumb.

  20. Woot! by 8bit · · Score: 1

    More justification to love python. I use it for everything. Unfortunatly the apache mod_python interface sucks badly if you want to use it the 'proper' way. But this anygui sounds great. I wrote an app in tkinter and made it into a stand alone windows program, but it had to include so much crap to make sure it ran, the simple program turned into a 3meg bloat. I wrote another program in pygame (SDL interface,) and it came out a lil smaller, ~1.5megs. But I think the main goal with anygui would be ubiquitousness. The GUI you need is already there, so if I were to make stand-alone windows programs, it wouldn't be bloated including the GUI libraries. This is great!

    --

    --Roy
  21. Look, it's return of the Mind-less wonder! by Anonymous Coward · · Score: 0

    According to Mentifex, all topics are relevant to Mind, which is a shitty AI which does nothing, based on a shitty theory which he dreamt up alone and nobody else respects.

    Was a word mentioned that could be fit into the same sentence as Mind? Well, clearly Mind is not off-topic!

    Who am I kidding? Alex Chiu doesn't even come close to this level of goofiness. At least he sells some magnets to suckers.

  22. Pythons big advantage over Java.... by Qbertino · · Score: 1

    Though Java rox as a language and was the first to implement the VM principle and has a huge set of APIs (which make for it's biggest advantage but often are written very haphazardly), it has one big downside in comparsion to Python.

    Python is GPLd. Java is not.

    If the other-way-around aproach IBM is taking now is crappy, there be no one stopped from enhancing it or writing a better one. Everyone can go by and rewrite any part of the Standard library if he thinks it's to slow. If IBM wants to bug SUN a little in the "nifty new language concept" dept., this is not the stupidest thing to do.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Pythons big advantage over Java.... by Anonymous Coward · · Score: 0

      The python license is not GPL !

      see http://www.python.org/cgi-bin/faqw.py?req=show&fil e=faq01.014.htp for more details.

      python's license is more like the BSD-like licenses.

    2. Re:Pythons big advantage over Java.... by webcrafter · · Score: 1

      And adding to the parent, I think SmallTalk already had a VM (not sure though)

    3. Re:Pythons big advantage over Java.... by Anonymous Coward · · Score: 0

      Note: Java was not "the first to implement the VM principle" (I have no idea what was, but it certainly wasn't Java), and Python is not GPLed.

    4. Re:Pythons big advantage over Java.... by Anonymous Coward · · Score: 0

      Smalltalk :)

    5. Re:Pythons big advantage over Java.... by GlowStars · · Score: 1

      Python is GPLd. Java is not.

      Python is NOT GPLd, it is more free than that.
      It ist *GPL-compatible*, though.

    6. Re:Pythons big advantage over Java.... by Anonymous Coward · · Score: 0

      Check your history books - Python existed before Java, and even so Python wasn't the first one to use a VM.

  23. Re:Mmm by TeknoHog · · Score: 2
    Now that's objective. I'm sure Guido agrees with me that Python is better, even not counting the OO features.

    Gotta admit that Python is probably the only computing environment I've encountered, which is both easy to learn and powerful in the long run.

    The downside is, of course, Python's more restricted syntax. I'd say Python and Perl codes compare like technical manuals and poetry. But when programming I'll rather take the tech (TeX :) route.

    --
    Escher was the first MC and Giger invented the HR department.
  24. Ok, this is getting ridiculous... by Anonymous Coward · · Score: 0

    I understand not wanting to make pike or forth topics, but you have done so many articles on python at this point, it's getting ridiculous! I know slashdot is perl-centric, but for the love of god!

  25. I'm for it by PeterClark · · Score: 1

    Having dabbled in Python programming, I see this as a Very Good Thing (TM). I read the article, and as others have pointed out, this is not a new GUI toolkit, but a wrapper for all of them. So now I can write Python programs that use both PyQT (Linux) and Tk (Windows) without having to learn two different toolkits.

    Now if only PyKDE2 would come out soon, so that I can start making a couple of kicker applets for KDE2. Of course, by the time PyKDE2 is out, KDE3 will have come out, and the whole cycle will start over again!

    1. Re:I'm for it by Anonymous Coward · · Score: 0

      afaik, pykde2 is about 95% done. a port to kde3 will not take much time ( a few weeks perhaps)

  26. Re:Let me get this straight... by Anonymous Coward · · Score: 0

    How is the parent post a troll? The guy *does* have a point. I mean, we have the gall to be discussing a Generic GUI Wrapper for Python?

    Python, quite frankly, fucking sucks. (Not as badly as Perl, but I digress). Python developers are morons who couldn't learn C++ properly. (And anyone who says C++ sucks is an uninformed moron. Pick up a copy of C++ Faqs, 2nd edition and read it cover to cover before you shoot your mouth off with uninformed gibberish and come off like an asshole.
    So yes, let's put this topic to bed where it belongs. (The number of comments attached to this story seems to prove my point that nobody gives a fuck about Python anyway.)

  27. Listing of available Python GUIs by Mochatsubo · · Score: 1
    For a fairly comprehensive list of Python GUIs check out Cameron Laird's page. Many interesting wrappers out there (PyQT, PyKDE, PyGTK, wxPython, VTK, FOX, etc).

    I love choice, but part of me wishes that more effort would go into getting wxPython/wxWindows polished (and more fully cross-platform) to knock Tkinter from its status as defacto Python GUI.

  28. Or... by Greyfox · · Score: 2
    Wouldn't it be cool to apply some of the cool stuff we found in Design Patterns?

    Sometimes we do write stuff just to learn. If what we've written also turns out to actually be useful so much the better.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  29. Not an IBM project by bulletman · · Score: 1

    anygui is not an IBM project -- it was just reported on in IBM developer works. If they write an article on java, does it mean they invented java? Sheesh.


    From the website:


    The purpose of the anygui project is to create an easy-to-use, simple, and generic module for making graphical user interfaces in Python. It's main feature is that it will work transparently with many different GUI packages on most platforms.


    You can use it to write a generic GUI app and it will scan the gui toolkits on your box and choose the best one to use for your app.


    A successful project with analogous goals is anydbm
    You can make generic operations on databases, and it will work on mysql and postgresql. It's already a part of the standard python distribution.

  30. wxWindows by Sludge · · Score: 2

    I am rapidly becoming a wxWindows fan. I've spent the last week or so learning this toolkit and implementing something like Gamespy or The All Seeing Eye.

    I admit this is the first GUI toolkit that I've used (for the desktop), but it seems to be very clear to use. I've got most of the standard functionality down now - events, windows/frames, window sizing, encapsulated string handling, etc, and I've only had to consult the mailing list for a single issue.

    I'm using it with C++, but there are some rather popular bindings for Python called wxPython, as well as Perl and an assortment of other languages.

    And the thing that gives me wood is that it looks native in each environment. GTK+ with themes under Linux, and Win32 GUI widgets under windows. And yes, it manages to do this without taking the lowest common denominator route: Sometime features like traybar iconifing under Win32 get plainly ignored under other OSes.

    Learned a new API this year? (If you are a coder...) If you have not, you're due.

    1. Re:wxWindows by bssea · · Score: 1

      Thanks for pointing this project out. I was in the midst of doing something very similar to this (exactly this actually). Now, I'll just throw my small weight behind this since they're a ways ahead of me.

      Now.. I have to go read their source.. go about your business..

      --sea
    2. Re:wxWindows by Sludge · · Score: 2
      It would seem to me anyone willing to undertake this entire project from scratch would be more than a small weight in the amount of contribution they could lend to the wxWindows effort.

      Perhaps an interesting project would be a wxWindows target for an MFC reimplementation.

    3. Re:wxWindows by JKR · · Score: 1

      Er, why? Most Windows coders are using ATL / WTL. Even MS don't actually _use_ MFC for anything except maybe Wordpad...

  31. I agree by AdamBa · · Score: 1
    This cross platform stuff is the crack dream of GUI programming going back 20 years. You get least-common denominator support for the underlying GUI, and another layer of code to harbor bugs.

    It's a great example of how an idea that seems good when discussing it in a CS class, falls apart where the rubber meets the road.

    - adam

    1. Re:I agree by bowb · · Score: 1
      It's a great example of how an idea that seems good when discussing it in a CS class, falls apart where the rubber meets the road.

      No, it's an example of a very real world thing called an engineering trade-off. They are trading-off feature richness for universality.

      If someone needs a universal GUI library, and can live with the lack of features, then this could be a good solution. They are attempting to provide one solution to a particular problem. For free. That is commendable.

  32. Defective O'reilly literature by Ukab+the+Great · · Score: 2

    Perl isn't an OOP language? Guess I need to tear out chapters 12-13 of my Camel Book.

    1. Re:Defective O'reilly literature by Anonymous Coward · · Score: 0

      you may want to 'bless' them before you rip them out ;)

  33. Don't forget about QT! by poet · · Score: 1

    http://stage.linuxports.com/projects/pyqt/book1.ht m

    The only book on Python and QT programming

    --
    Get your PostgreSQL here: http://www.commandprompt.com/
  34. Re:Mmm by elflord · · Score: 2
    that's because no perl code ever uses objects that they were implemented in such a bad way, but since no one uses them it doesn't matter,

    This is demonstrably false. The majority of the perl toolkits that I've used do make use of perl objects. Sure, in your 100 line web program or sysadmin script, it might not matter, but when you want to write scalable modular software, it does.

    On the other hand, most object oriented designs fail, take Gnome as the best example, circular library dependencies anyone?

    GNOME is not a good example of "object oriented design", because very few OO projects use C as the implementation language. As for circular dependencies, that is simply indicative of poor design.

  35. Not impressed by elflord · · Score: 2
    While the authors go out of their way to trash Java, I don't see how this is an improvement, in fact it looks worse. The problems I see are as follows:
    1. Write once, debug anywhere -- this is a criticism the author makes of java, but it does not seem clear that "anygui" solves this problem. In fact, I would conjecture that it makes things even worse, because of the fact that anygui programs are supposed to be able to run on an even more diverse collection of platforms (eg including curses) To rigorously test an anygui application, you would certainly need to test curses and windowed versions, for example.
    2. Ugly apps -- we're all familiar with the ugly-AWT app syndrome. The problem is that when you want to write an abstraction layer for several toolkits, you're stuck with the logical intersection of the feature set. The article explicitly mentions that "anygui" shoots at the lowest common denominator. This may have a useful niche for (eg:) installers, but for general purpose applications, it is not acceptable.
    3. Object oriented ??? -- No, it seems rooted in the callback/event-loop paradigm, and that means it's going to be difficult to write nice applications (the signal/slot mechanism used in GTK/Qt is much cleaner IMO)

    Anyway, I find it hard to get excited about this toolkit, because it looks to me like a solution waiting for a problem.

    1. Re: Not impressed by Anonymous Coward · · Score: 0

      Anygui will probably use the signal/slot mechanism
      in the next release. And while you may not see the
      problem it's addressing, it's quite clearly
      there. (Not for you, obviously, but frankly --
      who cares?)

  36. wxWindows by Anonymous Coward · · Score: 0

    I don't think it will come close to wxWindows. wxWindows already runs on OS9 and OS X, and a Mac port of wxPython is actively being worked on.

    While all the current ports of wxWindows use native widgets (when available), the wxUniversal port will provide an emulated set of widgets that will make it easy to port to other platforms until native support is available.

    Among other platforms, wxUniversal will run on Sci Tech's MGL library, which supports Windows, Linux, DOS, OS/2, QNX, SMX, RT-Target and other embedded operating systems. Other platforms (such as OS/2) are also being developed.

  37. Clarifications from the Author by Lulu+of+the+Lotus-Ea · · Score: 1

    I am David Mertz, the author of the referenced (but somewhat mis-described) article on IBM developerWorks about anygui. Some other folks have posted several clarifications, but let me try putting them together in one place.

    1. I am not the lead developer of Anygui. That honor belongs to Magnus Lie Hetland, who has been doing a wonderful job. As indicated in the article, or on the project page, I -did- volunteer to lead one tiny aspect (but have not yet done any work, for which I apologize).

    2. Anygui is not sponsored by IBM. I just write columns for IBM, and found the project interesting enough to devote an installment to.

    3. Anygui does not "repeat the mistakes of AWT", nor does it aim to replace another toolkit like GTK or Fox. Anygui is a *wrapper* around lower-end toolkits. The idea is that you can distribute *identical* source code to different users, on different platforms, and have it run with *some* available backend.

    4. Anygui will never be as feature-rich as many of its backend toolkits. It is not trying to be. The aim of Anygui is to provide a minimal, but -universal-, GUI API. If you want the full sophistication of, e.g. Swing, don't use Anygui. If you want users of Jython, MacOS native, Win32, and PyGTK (and others) to all be able to receive and run (without modification) your common Python code, Anygui is a brilliant project.

  38. anydbm isn't for MySQL and Postgres by HamishLawson · · Score: 1

    A successful project with analogous goals is anydbm. You can make generic operations on databases, and it will work on mysql and postgresql.

    anydbm is a generic interface to variants of the DBM database, not relational databases like MySQL and Postgres. For relational databases the generic interface is DB-API.

    Hamish Lawson

  39. anygui is precisely the AWT by SimonK · · Score: 2

    What the article describes - a common interface to the lowest common denominator of a wide range of GUI toolkits - is exactly what the Java AWT did. Unfortunately the intersection of all common toolkits is quite small: many don't support graphics on buttons, or sliders. There are also significant differences in the behaviour of the widgets between platforms that create problems. It looks to me as if you haven't examined the AWT and the reasons for its failure in enough detail, so you're going to make the same naive mistake again.

    On top of that, the callback/event-look API described surely went out with the ark.

    1. Re:anygui is precisely the AWT by Anonymous Coward · · Score: 0

      Anygui is not like the AWT -- it's even simpler.
      It's not (for now) a full-fledget GUI package.
      If you don't understand the objectives,
      assessing the chances of success aren't very
      good, are they?

      And... I assume you'd like a separate GUI thread?
      That assumes threading-support, which may not
      be present everywhere. wxPython works similarly,
      for instance, as does Tkinter. That's not
      something specific to Anygui.

  40. alternative approach by mj6798 · · Score: 2
    Python needs to bite the bullet, suck it up, pick one of the existing actively-maintained modern toolkits despite the possible flamewar, and then simply address its limitations (e.g. porting to platforms as required). Until then it won't have a standard GUI. Sometimes there is no silver bullet. ;-)

    Alternatively, Python should mature to the point that people can write a toolkit in Python itself, relying only on drawing primitives from the platform (the same could be said about Perl).

    1. Re:alternative approach by Jason+Earl · · Score: 2

      Alternatively, Python should mature to the point that people can write a toolkit in Python itself, relying only on drawing primitives from the platform (the same could be said about Perl).

      I don't think that this is a particularly good idea. Python is a scripting language, any GUI that relies too much on Python code is bound to be sluggish. That's the real beautty of wxPython (IMHO). It is a very nice wrapper around wxWindows, with a definite Python "feel." The fact that wxWindows is compiled means that WxPython GUIs are amazingly responsive. I ported some test apps from Java/Swing and was amazed at how much faster they ran and how much easier they were to write. WxWindows also uses the native toolkit, so your application appears to fit in with the rest of your environment.

      Of course, I am more than a little biased, I personally think that a mixture of Python + C (or in this case C++) is about the perfect development blend. Prototyping is fast and easy, and Python is so easy to extend in C that making the application fast enough is very straightforward.

      Anygui sounds like a nice idea, but any abstraction layer generic enough to include ncurses isn't likely to be capable of creating very complex GUIs.

      Of course, if they prove me wrong, well I will be pleasantly surprised. I have wrong once or twice before :).

  41. Re:Mmm by cyberlync · · Score: 1


    This is what people who have never truly grasped OOP always say. It seams to be 'I don't know how to use it so it must be bad!'. This is, of course, utterly false. OOP projects take a bit longer to create but maintainability and extensablity more then make up for it.


    As for the speed issue, that argument was made when programmers moved from C to Assembler. I am sure there are still a few assembler programmers out there saying


    'What's this shit with Procedural Programming? PP is a sinking ship, it's been already demonstrated a hundred times that it shows no advantages (except for morons who don't know what they're doing) and is always 5-500 times slower, take C for example.'


    So your argument is worthless. I would say pick up and OOP book and spend the next six months or so tring to come up to speed. When the 'Aha' moment strikes you may take back your post.

    --
    I'm a programmer, I don't have to spell correctly; I just have to spell consistently
  42. Python is great... by Junta · · Score: 2

    I especially think PyGTK is an example of somewhat relatively well-done work. In my experience with Perl and Python, Python tends to lend itself better than Perl for maintenance. However, the way in which data members of a class can be declared *anywhere* could create problems on larger projects. Also, having to have self as an argument to your class functions is a bit strange, and having to reference all class methods and members explicitly through self is a bit strange too, strange way of distinguishing between local and class methods and variables. And the way private vs. public is a bit strange. Other than this, I really like Python, a really impressive interpreted language, with a really excellent way to interface with C code, more impressive to me than any other non-C language, espeically makes JNI of Java look like complete crap.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  43. Why not a language-neutral protocol? by Tablizer · · Score: 0

    Why does a different cross-platform interface need to be built for each language? Wouldn't it make more sense to have a set of API's that works for all languages (or at least the common ones)?

  44. tkinter by Mad+Marlin · · Score: 1
    ... on Linux, TKinter ...

    Actually, tkinter works cross-platform. I use Python a lot, and I have used tkinter on Macintosh (an old 68040, not a modern Mac) as well as UNIX. I am told that tkinter works in Windows, but I have never used it there myself. As far as I know, you don't need to change your code either, or at least I have never had to. If you are using Python to do something GUI-style, tkinter is an excellent choice, especially because of the easy cross-platform support.

  45. OOP Flamewar! Food fight! by Tablizer · · Score: 0

    >> This is what people who have never truly grasped OOP always say. <<

    And people who claim to grasp it cannot provide evidence that it is objectively better. OO has become an Anecdote Club.

    >> PP is a sinking ship, it's been already demonstrated a hundred times that it shows no advantages.....OOP projects take a bit longer to create but maintainability and extensablity more then make up for it.
    <<

    If precedural and OO are the same, but OO has a longer learning curve, then doesn't it make sense to stick with procedural?

    The biggest problem with OO is that its assumptions about the patterns of change are pretty much wrong. However, people believe them because those patterns are the only ones people are trained to recognize due to inundation by OO texts. IOW, OO is the right solution to the wrong problem.

    oop.ismad.com

  46. It's like the XML parser model by 4thAce · · Score: 1

    The idea of a API which provides a way to hook into whatever provider exists on a platform reminds me of the SAX XML event-driven interface. Right now it does not seem to provide much that an effort to port Tkinter to the "minor" platforms might give you, but maybe in the future it might be able to let a GUI app query the underlying provider whether certain capabilities (e.g. bitmaps on buttons) are supported and make intelligent choices based on that information.

    --
    Inventor of the LOLbalrog meme.
  47. Pythod as a very good RAD tool by Anonymous Coward · · Score: 0

    I'm a Delphi and Python developer. I consider both to be RAD (Rapid Application Development) tools.

    If Python had a good GUI builder similar to Delphi or VB, I belive it would be a revolution in software development.

    Python stands in a class by itself. I consider it not a RAD tool, but a VRAD tool (Very Rapid Application Development). Unfortunately this qualificative does not apply to the GUI building, where Delphi or even VB are a lot better than it.

    I have tried several available libraries, including wxWindows. It simply does not compare to Delphi.