Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

Games in Python, - Better to use a Java JFrame for the game Window?

Hi
I am nearly ready to begin my foray into games in Python. However, is it more advisable to incorporate a JFrame for the game Window? Is Python GUI up to speed?

Thanks
Avatar of dbrunton
dbrunton
Flag of New Zealand image

What types of games are you proposing?
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Hancock

ASKER

Thanks

This won't be for money. I'd like to know as much about Python Frames as I do AWT and swing.

I'd like to know where opinion stands on incorporating Java into a Python project? Is it considered a cheap fallback? It sounds like it isn't that simple. Why? Can you not pass in data to methods and get returned values?

Must it all be ported to pure Python, - also, if I'd ever like to offer it as open-source, these days? (Is Java history?)

I don't need Starcraft 2 graphics yet. It sounds like Python Frames could be adequate for anything I used to be able to do? Should I not be concerned about their ability to be as good as JFrames?
Avatar of dpearson
dpearson

>> I'd like to know where opinion stands on incorporating Java into a Python project?

Pretty close to impossible.  A Java program is a set of bytecode (instructions) which you can't actually execute.  Instead you run Java (actually a Java virtual machine) and that reads the bytecode and executes the program.  So you must be running a Java virtual machine in order to execute Java code.  E.g. To run a java program you say:
"java -jar mycode.jar" <== see how you run "java" not "mycode.jar"

Python does not include this virtual machine - so there's nothing to "run" the Java code.

There was an effort to build a version of Python that could run inside Java (http://www.jython.org/index.html) but that's not really Python.  And I think it died a while ago.

If you had a C (or C++) program already and wanted to call part of that from Python, that would be possible.  Because a compiled C program  is directly executable.  It doesn't need something else to run it.

>> Must it all be ported to pure Python,
Yes (see above)

>>  also, if I'd ever like to offer it as open-source, these days?
You can make your Python or Java or anything else open source if you like.

>> (Is Java history?)
No it's going strong, but it's almost exclusively used for server code these days - i.e. stuff with no GUIs at all.

Good luck,

Doug
Thanks,

One thing also,
My Pycharm, interpreter is Pycharm CE 2016. 3.3.3

The woman in one Pygame install has 3.6.2
I've wondered if this is possibly my entire problem, upgrade incompatibilities?
Also, must I do anything specific to let the install know where my pygame must be installed, or does it always look in applications/pycharm
Thanks
Those are all totally different questions from the original - I'd start a new topic if you're having problems with your python install and get some other experts to weigh in to help.

Doug
Thanks
I'll do the Python install question, but do you suspect that the different versions, interpreters, are a plausible reason for my problems?
Certainly could be.  Python is one of those languages which suffers from slightly different libraries and installations resulting in very different behaviors.  Package management is a problem in many languages.
Thanks All