views:

440

answers:

8

I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose.

I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows.

My goals: 1. to make GUI using as less custom components as possible. 2. to make it as cross-platform as possible

(I know already that CPython and Jython are cross-platform-friendly, but what about IronPython+Mono?)

So - the question is about GUI - what should I choose?

+6  A: 

IronPython with Mono is cross platform - to whatever platforms supported by Mono, and for the feature set supported by Mono (which pretty much means Windows Forms is supported fairly well). Other options for GUI toolkits are available, however, which may provide better "cross platform" capabilities, or at least a better feel on non-Windows platforms.

CPython will depend on the GUI suite you choose. Personally, I've found CPython with PyQt to be the most usable, cross platform GUI option from Python. It's very powerful, feature-rich, and works quite well.

Jython will work, but I personally don't like the GUI options as much (this is a 100% personal preference, however).

Reed Copsey
+4  A: 

I'd say that if cross-platform is a goal, forget IronPython. A lot of people hate the dependency hell it causes so it'll be too much work to get it up in running in some OSes/distributions. Jython will suffer this also, albeit to a lesser degree.

Gianni
Jython? I thought Java is reeely cross-platform choice. Is Jython<Java in terms of cross-platfromness? (should not be, but may be there are some extra dependencies?)
Halst
IronPython with Mono is pretty easy to run on other platforms, from my experience. Mono's pretty straitforward to setup and Windows Forms is supported in the distribution...
Reed Copsey
@Halst Exatcly: It is only less platform-independent than CPython because Jython needs Java and the Python-Java bindings. CPython only needs CPython. So it really is only less cross-platform if you consider that requires more work to get it going, since you'll find more platforms with CPython pkgs by default.
Gianni
@Gianni: may I disagree? Unless you are using Tkinter which is not preferred by many Python developers, you are more likely to have Java than the other dependencies required by other GUI options: wxWidgets, pyQt and pyGtk are all less likely to be installed on Windows than Java. Even on Linux, wxWidgets is less available than Java, and pyQt and pyGtk as well on GNOME/KDE systems.
Muhammad Alkarouri
@Muhammad You do have a point there; my point was more on the IronPython option than Jython. The problem I mention is getting the Java+Python bit running. Last time I tried, I had much more trouble than just using apt-get/emerge/ports/etc to get PyQt running.
Gianni
+2  A: 

Take a look at comparable GUI's written in python/jython/ironpython. Look for programs that you like and find out what they use. I guess most if not all will be written in cpython + gtk or cpython + qt. I think all gui toolkits in python are cross platform.

DiggyF
http://bazaar.canonical.com/en/ has a great GUI that's cross platform - it's written in PyQt. There are lots written in PyGTK, too.
Wayne Werner
+4  A: 

Well, Mono does not come with the base of most Linux distributions. It's not a terribly lightweight dependency either, and I think Java is considerably more likely for people to already have. Would you plan on using "Winforms" with Mono? If so, and you don't have experience with Winforms, read about what others have to say :-) The other .NET GUI toolkit is WPF, which unfortunately Mono has no plans to implement.

Jython would be better too, because you can use SWT, which renders native widgets and provides lots of layout possibilities easily. Or you can use Jython with Swing, or whatever else -- even AWT if you love ugliness.

I really like wxPython (which you can use with CPython, which is on most distros by default), because it renders good-looking native widgets in OSX, Windows and Linux (I've only seen the Gnome widgets in person). wxPython is by far the easiest to use GUI toolkit I've used -- even programatically (i.e. layout without Glade or similar). I've also used SWT, which I found quite nice, and Swing, which I personally don't really like the looks of, and Winforms, which was a nightmare to try to do even simple layouts with.

Here's a quick comparison of the existence of the interpreter/language runtime by OS

  • CPython
    • Windows - Probably not installed, and you'd have to make a non-python installer install it with your software :-P
    • Linux - Probably installed (Ubuntu, Gentoo and RedHat all have system tools that are written in Python and run on CPython)
    • Mac - Preinstalled on OSX
  • Jython
    • Windows - Probably installed at some point in my experience, though it doesn't come with
    • Linux - Probably installed, but more importantly nobody would hate you for depending on it like Mono
    • Mac - Preinstalled on OSX ("Mac OS X Leopard comes with J2SE 5.0 preinstalled, based on JDK 1.5.0_13_b05" -- Apple's site)
  • IronPython
    • Windows - Will probably run fine because I bet most people have at the very least .NET 2.0 if they have a recent version of Windows
    • Linux - Probably not installed -- the only application with which I've used Mono on Linux was Rasterbator, which worked well but I felt weird putting .NET on Linux
    • Mac - See above

I would choose a GUI toolkit first, since that will very much impact the user experience and overall difficulty (I would choose wxPython but SWT would be a close second) then consider the above as well maybe as a tiebreaker.

bowenl2
+1  A: 

There are plenty of answers already, but I'd like to add one important thing - regardless of which library you learn, most of the principles will be the same when you move to another library.

I don't know about Qt, but for most graphics programs (in PyGTK or Tkinter) the best thing to do, as far as editing goes, is to use a PIL image (or something similar) to draw on and then draw that image on your canvas widget, otherwise you can lose pixel data if your window gets covered.

Wayne Werner
+2  A: 

I faced this same question roughly a year ago. After looking at all the alternatives, I ended up with CPython and PyQt. IMO, Qt/PyQt is by far the best choice amongst all of the Python GUI toolkits. After hitting many bugs in wxPython I switched to PyQt and never looked back. Qt/PyQt are much more solid than the wx toolkits in my experience.

I use the exact same code base and build stand alone executables with PyInstaller for Windows and Py2App for the Mac (PyInstaller can be used for Linux as well). Because these builders embed the Python interpreter and all of the dependencies, it takes a lot of the hassle away. The only rub is that you'll need both a Windows and Mac to do the builds. Getting all of the configurations correct can be a pain too, but it's possible and time worth investing.

brianz
+1  A: 

You may use Python 2.7 or 3.1 (CPython) with ttk (in Standart Library in 2.7, 3.1), ttk support themes (looks nice and very simple coding)

(1-st screen is text-editor with tabs and syntax highlighting) ttk screenshots

nazca
+1  A: 

Java is the most portable platform. Jython is written in 100% pure Java. 'Nuff said.

BTW I just switched a CPython/GTK project to Jython (trying to remove as much unmanaged code as possible), the only problem is that Jython is at 2.5 still, which kind of sucks when you're used to 2.6/2.7/3 :)

Longpoke