I have created a program about ‘Flying Flower Order’, but I don’t know how to publish it
It has a super large list
Sorry, I can’t quite understand it. I’m only 14 years old. This work, um, is a file that I wrote in Python 3.12. Maybe I should use three reverse quotes or something?I mean publishing it on this website for everyone to give some suggestions.
Can you make an account with Github (or other code hosting platform), create a publicly visible repo, and upload the code to that?
No,What’s the use of this? What should I do?
If you want to show us the code so you can get help with it, so you mean “How can I show code in a post”, then this is the advice. Thanks for asking. You can check you’re doing it right in the preview on the right. And afterwards, if it still isn’t right, you can edit your post until it is.
If you want to share code with others who might find it useful, then GitHub might be a good place to start. (People have given advice about how to publish a package on PyPI, but I think that is more advanced than you want.)
If you just want to show off your learning, and encourage others to try the same thing, then you could find somewhere to blog about it. You should check that it is able to display code properly. I don’t have any recommendations on where. (I’m beginning to think Medium would be a good place for my own use, but it costs money.)
Thank you, your help was very helpful.
Ah, I had indeed misunderstood what you were looking for. So, yes indeed it is as you and Jeff said: triple backticks is the most common solution. For more details, this website is built with “Discourse” and here are the references about how to write on a website built with Discourse:
- Posting code or preformatted text - Using Discourse - Discourse Meta
- Formatting posts using markdown, BBCode, and HTML - Using Discourse - Discourse Meta
If the piece of code is very long, as you mentioned, maybe you might hit some limit of the post size allowed by Discourse. In this case you might need to publish your code on some other website and add a link to it in your post. Typically developers use something like GitHub’s Gist, or something like Pastebin, and there are plenty of other solutions.
你好! 欢迎来到这个世界. Let me know if want help getting your code published. I teach Python, and I am happy to work with you to publish your code into a platform like Codeberg or GitHub, and to create/share your app.
// Jonathan
I have already created a GitHub account and completed something similar to an introductory tutorial. Perhaps I need to follow that tutorial again to create a new repository and upload my code to that repository?
If you have a github account, it’s probable not all the steps from the tutorial would be necessary to publish your code.
Personally I use VS code or gitkraken, both of which have nice “Initialise Repository” and “Publish” buttons.
When I want to publish code I go to the folder where the code is stored, initialise a git repository, stage all the files I want to publish, commit, then publish.
It is valuable to learn to do these steps via the command line too.
Note you don’t need to create a repository on github before uploading code to that repo. You can create a local repo, and then publish it to your account.
How to create a local repo,and how should I publish it on GitHub?
It depens on how you’ve set things up. Are you using a terminal for everything, or some other program to interact with git?
Well done. Creating a repository is as simple as picking a name and filling this out: Sign in to GitHub · GitHub
Until you get the hang of committing, pushing and pulling you can upload a file, and edit them online.
Uh, I use Windows and my work is an IDLE file or something
I’m not actually familiar with IDLE, but there should be a folder in your system with a bunch of .py
files?
How do you use git?
There is a folder called Python 3.12, but my work is not in it, it is on the desktop. This folder is a bit strange. Since I installed Python 3.12, it has been in my start menu and I haven’t been familiar with it. I don’t know what Git is
Sorry I thought based on
that you already had git on your system.
Github is named after git. The canonical way to interact with github is via git, but uploading files manually as @JamesParrott recommended also works.
Your work should not be in the Python 3.12 folder.
Can you search your system for .py
files? In all versions of windows that I’m aware of this is possible, though sometimes it takes a long time.
Alternatively you can use a search engine (or chatbot) to search for “where does IDLE store my python files?” and similar search terms.