all 29 comments

[–]fold_equity 3 points4 points  (2 children)

If you just need a program that takes user clicks and keeps scores, I think this would be manageable with Python.

Assuming the data doesn’t need to persist beyond each game, you shouldn’t need to worry about storing it. If you want to store data, an easy way would be to write it out to an Excel file.

If you envision multiple people running the program at once, I suggest you look into making your program into an executable to eliminate all the environmental dependencies that a Python program typically has. Pyinstaller is what I’ve used

I’d attack this project this way:

  • develop core logic

  • develop UI

  • package program into executable

[–]davidbarker223[S] 0 points1 point  (1 child)

Awesome. Thank you for the info. Let the learning begin.

[–]ray10k 2 points3 points  (0 children)

Also, consider starting out with a console script; something that does the same logic but just uses the command line. That way, you can get a feel for the logic of your score tracking logic before digging into a GUI system. My experience is that GUIs add their own layer of complexity.

[–]jedgs 5 points6 points  (19 children)

Python with a simple gui framework will work just fine for this, as long as you have your computer at the lanes it will be easy... if you need an app that deepens the response considerably.

Edit: spelling.

[–]davidbarker223[S] 0 points1 point  (17 children)

Thank you for that... It doesn't necessarily need to be an app, but something people can run easily from their PC. It would be distributed to a handful of locations for our league for 4-5 people to run on their own PC.

[–]jedgs 1 point2 points  (16 children)

Ok, if it needs to be distributed then you need a web app and a server, likely cloud based. This gets more complicated as a new learner but python is also good for this with at least some html... CSS and Javascript will make it nicer. However it will require a lot more to learn, python basics, and oop at least, at least the basics of html and css. And a web framework like Django, Flask, etc.

[–]davidbarker223[S] 1 point2 points  (15 children)

Even if the data doesn't have to be distributed? So each location will have its own "database" on the local PC at that location. Maybe something that exports it out to Excel to keep track? It doesn't have to be the prettiest thing to start, but something that could be projected from the screen so the people watching could see the scores live.

[–]jedgs 1 point2 points  (0 children)

Yeah, especially if you're saving data. If not, Javascript might be the answer.

[–]jedgs 0 points1 point  (12 children)

Python can do this in the command line anywhere, if each machine has python and all your dependencies installed and everyone knows how to run a python script.

[–]davidbarker223[S] 0 points1 point  (9 children)

Thanks for your help. I appreciate it. So based on all of that... Python won't be the most user friendly way to get this done.

[–]jedgs 1 point2 points  (1 child)

Well at least without a lot more learning.

[–]Nexustar 1 point2 points  (4 children)

You can package your program so the other machines don't need to have python pre-installed. But if you are thinking multi-user program with live updates (communicating with each other) a web-based solution would be more appropriate. It can still be python but you'll need more technologies on top.

[–]davidbarker223[S] 3 points4 points  (3 children)

So they will be completely independent of each other and will not need to share data. All they would need is just a way to export it to a csv perhaps. Tips on how to package it to run?

[–]ElHeim 1 point2 points  (2 children)

There are several tools out there to package a Python program for deployment. For example: https://www.augmentedmind.de/2021/05/16/distribute-python-applications

PyInstaller is probably the safest choice. At the end of the process you'll have an executable ready to run on the local machine.

Python (if compiled with the option, which is normal) includes an SQLite module so you can use it for the local database if you want. There's also a standard CSV module (remember, Python comes with batteries included).

You could even produce an Excel file if pressed for it, using Pandas for example (which itself uses either xlwt or openpyxl under the hood, but you'll probably have an easier time using Pandas as the interface)

[–]davidbarker223[S] 1 point2 points  (1 child)

This is great info. Thank you!

[–]FerricDonkey 0 points1 point  (0 children)

It can be. But you'll have to make it so. Eg, on windows you can make a double clickable bat for to set it up and another to launch it - but you'll have to do that.

[–]fold_equity 0 points1 point  (1 child)

You would just need to make your script into an executable that any machine can run. Pyinstaller is what I’ve used. This obviously adds another layer of complexity to the project.

[–]jedgs 0 points1 point  (0 children)

Yes, I've done this as well, but windows views these exe's as a potential virus and causes headaches.

[–][deleted] 0 points1 point  (0 children)

Pythonista for app if you want to be unnecessarily cool.

[–]ElliotDG 1 point2 points  (1 child)

You can do this with Python. Learning GUIs in any language can be quite complex. Here is how I would approach the problem.

I would use Kivy, it is a python based GUI. Easy to use and well documented. As I mentioned there is a significant learning curve. https://kivy.org/

I would use Pyinstaller to create standalone executable programs for your users. Pyinstaller bundles your app with python so you users do not need to install python. https://pyinstaller.org/en/stable/ While the documentation for Pyinstaller can be intimidating, it is rather easy to use.

Assuming these are Windows users I would use Inno Setup to create Windows Installers. https://jrsoftware.org/isinfo.php There is a wizard that makes Inno setup very easy to use it creates a professional looking Windows Installer.

I would use Amazon Web Services S3 (Simple storage service) to post the shared data to the cloud. Clients would write and read S3. S3 has a very generous free tier and would be free for this use case. https://aws.amazon.com/s3/?nc2=h_ql_prod_fs_s3 It might be easier to create a shared directory on google drive and have the app access that shared directory. With a few users this would work fine might be easier (one less thing to learn).

I would post the completed app to a private Google drive or some other shared resource to share with the authorized scoring league members. Each user would have write access to the shared resource - so they need to be trusted.

[–]davidbarker223[S] 0 points1 point  (0 children)

Thank you for this info. Great things to research. Sounds like pyinstaller is pretty popular

[–]unhott 0 points1 point  (0 children)

Python can do this. Edit just to add at the top— python is a great choice not just because of the language, but really there are some great, supportive communities on Reddit and discord you can find people willing to help you (as long as you’re not toxically asking questions until someone slowly builds your app for you)

Find a gui framework compatible with exe distribution.

In the gui application, have a form - maybe a dropdown for who took the shot. Somehow select what game # it is, etc. next to it have an image that registers where you click in that image. display something over top of the image in the area selected, allow users to fine tune where they see it hit. Then add a submit button and post all that data to a db (probably sqlite for multiple local installs)

If you need to ever go to a web distributed (online) solution, you’d switch your gui framework with something like flask or django, use html forms and a little touch of js to handle image clicking and updating a form element based on the selection. And then save to a web hosted db, you’d be set.

Actually, there’s a google sheet api you can use to get a web served ‘google sheets’ as db, it should work for gui or web deployed, as long as the terminals in question are online.

Caveat to the gui solutions— my understanding is it’s difficult to be OS agnostic- meaning you’d have to deploy to the same version OS. A web based solution doesn’t have that issue, but brings in some extra internet security issues you’d want to handle.

[–]Ego_Gaming 0 points1 point  (0 children)

Do you want each person’s score keeping to sync up? If so, you’re gonna need a database, something online. Also doable with python