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

James Hancock
James Hancock used Ask the Experts™
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?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.

What types of games are you proposing?
if you're writing your game in Python, you should use a Python GUI.  It would be a major nightmare to try to use a JFrame (or any other part of a Java library like Swing) in Python.

I've heard people say good things about Cocos2D ( which is all in Python and should be fine for any 2D game you might build.

Hope that helps,

Is Python GUI up to speed? Depends will you be using open GL?
For money?
VR is the future
Graphic User Interface FAQ is worth a read,
There is so many changes coming with game platforms versus computer systems. Microsoft pushing for mobile platforms windows as a Service, Steam has fully integrated to Cloud.
If you have time have a look at this, the games created using Amazon Lumberyard is amazing to say the least.
Free. Powerful. Fully Customizable.
We believe game developers deserve another choice. That’s why we’re building Lumberyard: a game engine with no royalties or seat fees, frictionless integration with Twitch and AWS, plus much more on the horizon.
Example of a game built with it
Star Citizen CitizenCon 2017 KeyNote Highlights
Star Citizen about on Wiki
Cloud Imperium Games
Publisher(s)      Cloud Imperium Games
Director(s)      Chris Roberts
Writer(s)      Dave Haddock[1]
Composer(s)      Pedro Camacho
Geoff Zanelli[2]
Engine      Amazon Lumberyard
Platform(s)      Microsoft Windows
Star Citizen: TBA
Squadron 42: TBA
Genre(s)      Space trading and combat, first-person shooter
Mode(s)      Single-player, multiplayer
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

James HancockSelf Employed



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?
>> 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 ( 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,

James HancockSelf Employed



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
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.

James HancockSelf Employed


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.
James HancockSelf Employed


Thanks All

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial