Trying to choose between python and java

Kirk Job Sluder kirk at jobspam/mapssluder.net
Tue May 15 12:43:16 EDT 2007


Anthony Irwin <nospam at noemailhere.nowhere> writes:

> #1 Does python have something like javas .jar packages. A jar file
> contains all the program files and you can execute the program with
> java -jar program.jar

Python does this with eggs and distutils that copy your files into the
proper location.  For os x you also have py2applet which creates an
application bundle that can be put onto a disk image and dragged into
the Applications folder.  A similar utility exists for MSWin, but I've 
not used it.

> #2 What database do people recommend for using with python that is
> easy to distribute across linux, mac, windows.

pysqlite3 for python is included in python 2.5 and can be added to
python 2.4.  For java you would probably use HyperSonic or Derby.  At
least one winner in the java camp for me is db4o, which is a bit like
shelve on steroids with an object-oriented query language.

> #4 If I write a program a test it with python-wxgtk2.6 under linux are
> the program windows likely to look right under windows and mac?

There are enough idiom differences between OS X, MSWin, Gnome and Qt
that native look and feel is very, very difficult to achieve.  Java
comes close with SWT.  WxPython applications seem to port badly to OS
X, and are tricky to build into an application bundle.

As a example of how these differences in idioms can become problems,
Mozilla Thunderbird on OS X regularly has issue with unmodified
keybindings. With Thunderbird 2.0 shift-J marks a message as junk,
even when you are entering text into a dialog box.  The tkinter
application Leo uses the control key as a modifier on OS X rather than
the command key.  The basic point is that you need to test on all
platforms you want to develop for.

My very biased view of the domain is as follows:
OS X/Cocoa: PyObjC
KDE + Win + OS X/X11: PyQt
Win + Gnome + OS X/Carbon: wxPython or Jython+SWT
Simple, easy, and universal: tkinter
Rich, complex, and universal: Jython+Swing

> Also does anyone else have any useful comments about python vs java
> without starting a flame war.

I've found it useful to use a mix of pure java and jython, although
I'm still working through some gotchas in regards to compiling jython
code that's acessible from java.  

> -- 
> Kind Regards,
> Anthony Irwin
>
> http://www.irwinresources.com
> http://www.makehomebusiness.com
> email: anthony at above domains, - www.

-- 
Kirk Job Sluder



More information about the Python-list mailing list