[Tutor] [Q] Python, Jython, and drawing application
alan.gauld@bt.com
alan.gauld@bt.com
Tue, 30 Oct 2001 15:34:14 -0000
------_=_NextPart_001_01C16158.547DA020
Content-type: text/plain; charset="ISO-8859-1"
Hi, I'm new to Python programming and I have a question.
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 programming language to
Python, but I don't want to dump my Java application. If it's possible, how
can I do it?
Probably better joining the jython mailing list for
these but here's the little I understand(or think I do...)
Yes you can access your existing Java code, at least
at the class level. You can create and use Java objects
pretty much transpoarantly - thats whjat happens when
you use the AWT for example.
Any good tutorials? How about performance?
My informal testing suggests Jython is about half the
speed of native Java. Or about a quarter the speed of
CPython.
I have read the Python tutorial and I felt like Python is most focusing a
server programming.
Its a general purpose language like C++ or Perl etc.
(Relatively little documentation and tutorial on GUI exists.)
If you mean books then I agree, there are several
online resources tho', especially for Tkinter.
How difficult would it be to develop a petri net drawing or a UML drawing
application?
Check out DIA - it is a Visio like drawing package
written in Python. At least I think it is - I might
be confusing it with something else - Sketch maybe?
There definitely is a drawing package out there
written in Python. So yes you could build a UML
tool.
You could also look at the now obsolescent Grail
web browser, also written in Python.
Is there any example code for these kinds of python application?
Both of the above are opensource so you can
download the code.
Alan g
------_=_NextPart_001_01C16158.547DA020
Content-type: text/html; charset="ISO-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META content="MSHTML 5.00.3013.2600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT face=Arial size=2>Hi, I'm new to Python programming and I have a
question.</FONT></DIV>
<DIV><FONT face=Arial size=2>If I make a Jython application, can the Jython
application use the Java application?</FONT></DIV>
<DIV><FONT face=Arial size=2>I have a Java application and I want to switch my
programming language to Python, but I don't want to dump my Java application.
If it's possible, how can I do it? <SPAN class=230522815-30102001><FONT
color=#0000ff face="Courier New"> </FONT></SPAN></FONT></DIV></BLOCKQUOTE>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>Probably better joining the jython mailing list for
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>these but here's the little I understand(or think
I do...)</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>Yes you can access your existing Java code, at least
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>at the class level. You can create and use Java objects
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>pretty much transpoarantly - thats whjat happens when
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>you use the AWT for example.</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT size=2><FONT face=Arial><SPAN
class=230522815-30102001> </SPAN>Any good tutorials? How about
performance?<FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001> </SPAN></FONT></FONT></FONT></DIV></BLOCKQUOTE>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>My informal testing suggests Jython is about half the
</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>speed of native Java. Or about a quarter the speed
of </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>CPython.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001></SPAN></FONT></FONT></FONT> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT size=2><FONT face=Arial>I have read the Python tutorial and I felt
like Python is most focusing a server programming. </FONT><FONT
face=Arial><SPAN class=230522815-30102001><FONT color=#0000ff
face="Courier New"> </FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=230522815-30102001></SPAN></FONT></FONT> </DIV></BLOCKQUOTE>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>Its a general purpose language like C++ or Perl
etc.</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT size=2><FONT face=Arial><SPAN
class=230522815-30102001> </SPAN>(Relatively little documentation and
tutorial on GUI exists.) <SPAN class=230522815-30102001><FONT
color=#0000ff face="Courier New"> </FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=230522815-30102001></SPAN></FONT></FONT> </DIV></BLOCKQUOTE>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>If you mean books then I agree, there are several
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>online resources tho', especially for
Tkinter.</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT size=2><FONT face=Arial><SPAN
class=230522815-30102001> </SPAN>How difficult would it be to develop a
petri net drawing or a UML drawing application? </FONT><FONT
color=#0000ff face="Courier New"><SPAN
class=230522815-30102001> </SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001></SPAN></FONT></FONT> </DIV></BLOCKQUOTE>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>Check out DIA - it is a Visio like drawing package
</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>written in Python. At least I think it is - I might
</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>be confusing it with something else - Sketch
maybe?</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001></SPAN></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>There definitely is a drawing package out there
</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>written in Python. So yes you could build a UML
</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>tool.</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001></SPAN></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>You could also look at the now obsolescent Grail
</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>web browser, also written in
Python.</SPAN></FONT></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT size=2><FONT face=Arial>Is there any example code for these kinds
of python application?<FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001> </SPAN></FONT></FONT></FONT></DIV></BLOCKQUOTE>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>Both of the above are opensource so you can
</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001>download the code.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff face="Courier New"><SPAN
class=230522815-30102001></SPAN></FONT></FONT></FONT> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT color=#0000ff face="Courier New" size=2><SPAN
class=230522815-30102001>Alan g</SPAN></FONT></DIV></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C16158.547DA020--