r/learnpython • u/RegretSimple6826 • Jan 31 '25
Best package for deploying to Github
Hi everyone,
I did a bit of Python for my data science course many years ago, so would like to continue using it over HTML/Javascript/Angular JS which I know nothing about.
I am hoping to create a text based game and deploy it on to Github. Note that I want to deploy it, not upload code for others to download and run locally. I want it accessible over a URL.
What options do I have? I heard that if I build it into Pycharm then it becomes possible? I am happy to learn a new package just for this, so would like some advice on what I should focus on learning.
Thanks!
21/08/2025 -
7 months later, I have it all figured out. Life caught up with me hence the late update. Everyone here told me it was impossible, but, well, they are wrong. I have no doubt of their technical skills, but without a genuine interest in helping those skills are meaningless. The world as they know it is confined to what they have seen before, and they refuse to entertain the possibility of things existing outside of it. Being unheard of means you haven't come across it yet, not it is impossible. As it turns out, it is relatively straightforward. I leave the answer here for posterity, in the hope that I might help some other fellow rookie programmer with a similar passion.
Learn pygame, use pygbag to compile it, then upload to Github pages. You can make much more than a text-based game and deploy it to the internet for free using this method.
https://pygame-web.github.io/wiki/pygbag/
12
Jan 31 '25
GitHub is for hosting static pages. Python won’t do that
2
u/Pork-S0da Jan 31 '25
He could use something like Github CodeSpaces, but given the questions he's asking, I doubt he could make that work.
-20
u/RegretSimple6826 Jan 31 '25
My friend has rewritten my Python code into HTML in the past and hosted my text based game on it. It should be possible if the only difference is language type.
I don't have the luxury of his help now, so I have to do it myself.
9
u/cgoldberg Jan 31 '25
Since HTML is simply a markup language, you can't "rewrite Python code into HTML". You could perhaps do it in JavaScript with HTML, but what you are describing doesn't make any sense.
32
u/Pork-S0da Jan 31 '25 edited Feb 01 '25
I'm here to watch OP argue with all the answers he doesn't want to believe.
5
10
u/JamzTyson Jan 31 '25
I am hoping to create a text based game and deploy it on to Github. Note that I want to deploy it, not upload code for others to download and run locally. I want it accessible over a URL.
As others have said, GitHub does not provide a deployment platform, though it does provide "GitHub pages" for hosting static web pages.
My friend has rewritten my Python code into HTML in the past and hosted my text based game on it.
My guess is that they rewrote your Python game in JavaScript, embedded the JavaScript in an HTML page, and hosted that on Gitub Pages. To do that, you would need to learn how to program in JavaScript.
5
4
u/typehinting Jan 31 '25
Given the restrictions you have expounded upon in your post and comments, you have no viable options
5
u/QuarterObvious Jan 31 '25
As Robert Sheckley wrote: "In order to ask a question you must already know most of the answer."
0
u/kjmagic13 Jan 31 '25
GitHub pages? https://pages.github.com
1
u/RegretSimple6826 Aug 21 '25
Thanks, you are right. Github pages + pygame + pygbag worked like magic. Late reply I know, but life got in the way of my side project. I do appreciate your answer. You were genuinely trying to help and it met all my requirements.
26
u/danielroseman Jan 31 '25
Unfortunately this question is very confused. GitHub isn't a platform you can deploy to, it's a place for holding code repositories.
If you want someone to play your game online then you will need some kind of web server. But additionally you will need to rework your code to be a web application; you can't just run Python over the web.