[Tutor] [Q] Python, Jython, and drawing application

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Mon, 29 Oct 2001 21:09:46 -0800 (PST)


On Mon, 29 Oct 2001, Young-Jin Lee wrote:

> Hi, I'm new to Python programming and I have a question.

I hope you are having a fun time with Python so far.


> If I make a Jython application, can the Jython application use the
> Java application? I have a Java application and I want to switch my

Yes, this is one of the really neat things about Jython: all the Java
classes look as though they were Python classes.  Here's an example:

###
[dyoo@tesuque dyoo]$ jython
Jython 2.1a3 on java1.3.0_02 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import java
>>> mylist = java.util.ArrayList()
>>> mylist.add("Hello")
1
>>> mylist.add(" ")
1
>>> mylist.add("world")
1
>>> mylist
[Hello,  , world]
###


> programming language to Python, but I don't want to dump my Java
> application. If it's possible, how can I do it? Any good tutorials?

The Jython web site,

   http://jython.org/

has tutorials on getting Jython working.  You might also want to ask the
Jython mailing list for more information particular to Jython:

    http://lists.sourceforge.net/lists/listinfo/jython-users


> How about performance?

Err... I wouldn't touch that question with a flagpole.  *grin*




> I have read the Python tutorial and I felt like Python is most
> focusing a server programming. (Relatively little documentation and
> tutorial on GUI exists.) How difficult would it be to develop a petri

There's actually a LOT of documentation on GUI interfaces, if just not
well advertised... *grin*


You'll definitely want to look at:

    http://python.org/topics/tkinter/

which is the main "Topics" corner for Tkinter stuff.  This page has a link
to a very nice tutorial on the Tkinter GUI interface here:

    http://www.pythonware.com/library/tkinter/introduction/index.htm


Moreover, Cameron Laird has accumulated a lot of information on Python
GUI's:

    http://starbase.neosoft.com/~claird/comp.lang.python/python_GUI.html

which tries to catalog all the GUIs developed for Python.  A bit
overwhelming, but nice to know about.


Finally, there's an article on IBM developerworks that touches on a
universal 'anygui' module that tries to unify the gui frameworks:

    http://www-106.ibm.com/developerworks/linux/library/l-anygui/

and the resources at the bottom of this article might be useful for you.




> net drawing or a UML drawing application?  Is there any example code
> for these kinds of python application?

Dunno about this one.


If you have more questions, please feel free to ask!