I want to build a GUI where users select a baseball pitch and location, then pass that information to a Python program as JSON. I know Python, R, JavaScript, C#, Lua and SQL, but I'm open to learning something new. What would you use?
What language would you use for a pitch selection GUI?
Answers
I'd keep it in Python and use PySide6 for the interface. You already have the processing side in Python, so you can spend your time on the pitch and location controls instead of connecting two languages.
You can still write out JSON if you want a file between the interface and the processing code. If both parts run in the same application, passing Python data directly might be simpler.
Reply to this answer
JavaScript is a reasonable choice if a browser interface appeals to you. Plain HTML, CSS and JavaScript can handle the controls without a framework. TypeScript is an option if you want to learn something new.
For a web app, a small Python API using FastAPI could receive the selections as JSON and send them to your existing processing code.
Reply to this answer
If you prefer C#, take a look at WPF or WinUI for the desktop interface. Both give you another way to build the controls, though you'll need to decide how the C# app and Python process exchange the JSON.
Reply to this answer
The baseball part doesn't really dictate the language. A pitch can be a selection control, while the location might be a pair of coordinates or a click on a visual area. Pick the interface style you want first, then choose a toolkit that makes those controls comfortable to build.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions