Hello,
today I tried Jython for the first time. I created a file test.py, containing Python and Java code which creates a GUI using Swing.
It works, I can try it using the command "jython test.py".
But how can I create an executable file?
Thanks for every help.
3 replies to this topic
#1
Posted 11 November 2011 - 08:29 AM
|
|
|
#2
Posted 11 November 2011 - 10:52 AM
Python is a scripting language, so you don't normally compile it to executable. With that said, there are some workarounds.
#3
Posted 11 November 2011 - 11:21 PM
Yes, I know. But with Jython it should be possible to compile it to executable *.jar-files. How does it work?
OK, my source code:
I saved it as test.py and run it using "jython test.py". What do I need to enter in the console (or a batch file) to compile it as a *.jar-file?
OK, my source code:
from javax.swing import JFrame, JButton
frame = JFrame("My first swing GUI", size=(300, 150))
button = JButton("Click me")
frame.add(button)
frame.visible = True
print("Close this window")
I saved it as test.py and run it using "jython test.py". What do I need to enter in the console (or a batch file) to compile it as a *.jar-file?
#4
Posted 12 November 2011 - 11:43 AM
I haven't used it, but I'm guessing these would be good resources:
The Definitive Guide to Jython — Jython Book v1.0 documentation
Current Documentation
The Definitive Guide to Jython — Jython Book v1.0 documentation
Current Documentation
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









