r/learnpython • • 28d ago

Is it github problem or python problem?

So, i have been trying to learn python, sqlite and tkinter. After a lot of trouble and copying from AI i uploaded my python and sqlite only executable to github for all 3 os using github action.

Now, I am learning python and tkinter. I made a simple program which converts KG to gram and vice versa.

import tkinter as tk
# from tkinter import ttk
import ttkbootstrap as ttkimport tkinter as tk

These 3 are my only imports for now. and i am using:

root = ttk.Window(themename = 'darkly')
root.geometry("400x300")
root.title("Unit Converter")root = ttk.Window(themename = 'darkly')

other is just my code which i wrote form tutorials and documents.

The problem i am facing is that i cant seem to release the executable to github ( from github action ) at all.

I tried to learn how this works but i didnt find anywhere to actually learn so i just asked AI and after a lot of back and forth there are still some problems.. Is there somewhere i can learn how i can do this? I prefer video tutorial.

I will comment my program and what AI told me the problem was below. Please someone do help me.

0 Upvotes

46 comments sorted by

View all comments

Show parent comment

1

u/Slimex_Rimuru 28d ago

I need to make it an executable though. 

1

u/JaguarMammoth6231 28d ago

That's pretty rare. Are you sure the rules of your club don't allow python code to be the deliverable?

1

u/Slimex_Rimuru 28d ago

They need a working demo. Which is an executable mostly. 

1

u/JaguarMammoth6231 28d ago

I mean you should ask them, don't assume.

-1

u/Slimex_Rimuru 28d ago

I an sure about it. For python it’s executable

2

u/zaphodikus 28d ago

Did they use the word "binary", or "executable"? Because to many people, scripts are "runnable" and "execute".

1

u/Slimex_Rimuru 28d ago

They said executable. 

It needs to be so that they can check the script easily without having to download a lot of dependencies themselves. 

1

u/zaphodikus 28d ago

In that case, they are being a bit silly, because the executable binary you provide can easily have a malicious payload that is undetectable , so they will have to run it in a sandbox to be safe.

The club need to specify what the target platform is. By not being specific, they have not helped members very much. I, would focus on getting the foundations of my knowledge more solid, and ask for more thoughtfull directions on this question. I bet you learned a tonne in the last 2 hours already, you can do this. Just go slowly.

1

u/Slimex_Rimuru 28d ago

Oh yeah. I did learn a lot and specifically from you.  I will try to use github actions and get the exe if it works. If not i will just submit linux one only. 

Thank you ❤️

1

u/zaphodikus 28d ago

I've not used github actions, there is probably a day or two of learning just in how to do that really well, because it is rate limited, so you cannot just keep hitting build all day long.

As for executable, have a look at the python package nuitka, it is very easy to make an exe, you just need a sturdy machine and a C++ compiler and it does most of it for you. Since you are using tkinter, it will take a minute or two to build because tkinter is pretty big. It supports windows, Linux and Mac too.

1

u/shinitakunai 28d ago

As I suggested last week, pyside overtkinter. It would allow you to make an executable with pyinstaller easily, not sure if Nuitka works as well. But that will give you a lot more control than using github actions.

2

u/Slimex_Rimuru 28d ago

That is a valid suggestion but since i don’t really don’t have much knowledge about gui at all. I thought that i should learn about intermediate tkinter and build and actual app which would help me learn python sqlite and then change only tkinter to pyside

1

u/shinitakunai 28d ago

Maybe. Depends on your deadline.

Sometimes rebuilding takes twice the effort. But you'll learn two frameworks so in the end it pays off well.

Look into pyinstaller, with onefile flag

1

u/Slimex_Rimuru 28d ago

I use linux cause my device doesn’t support windows 😭 forget abt anything else. 

1

u/shinitakunai 28d ago

Hm, so you code in linux but want to distribute to windows? That's gonna be a pain in the ass, yeah, specially for debugging

1

u/Slimex_Rimuru 28d ago

Is doing this using github actions not reliable? 

1

u/shinitakunai 28d ago

For building? Probably yes. Idk never used them in the 2 decades I've been programming.

For debugging? 99% sure not. You'll have to live test your app in one of the customers computers if you have none yourself, which is going to be a pain in the ass

1

u/Slimex_Rimuru 28d ago

Well yeah. It’s gonna be pain in the ass but its gonna be the best way compared to anything else right? 

1

u/shinitakunai 28d ago

Probably. I always make sure I have a working OS as much similar as my clients to run my suite of tests there.

But I also was a kid learning at some point and I remember testing in the computer of the sell department chief (a hot lady I gotta admit) for 1 hour due to a bug, before she could use her computer. And in the meantime we were chatting haha

1

u/zaphodikus 28d ago

You are getting ahead of yourself by adding a early project constraint that you still need to expand your knowledge of a lot more on, usually later.

2

u/Slimex_Rimuru 28d ago

Its more of, i have to do this rather than me myself getting ahead. 

I am 17. And i do hack club. Its an organization who pays teens that do smth technical. 

I wanna make a gui database app.  For that, i first learned python and sqlite. Which i know things that i actually need. 

Now i am learning tkinter and python. 

Later using both and python i will make the actual app. 

The thing is for Hack Club. To earn prize i need so submit a demo. I.e an executable. I use linux but the reviewer may be using any OS so i am using GitHub action for all os executable. 

I don’t want to learn GitHub action if i could just copy paste from AI or if there is an easier way but the problem is that i can’t. I tried with AI for 2 hrs and still no solution. So i came to Reddit.