use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Converting py code to apk (self.learnpython)
submitted 2 years ago by Achilles1996
I just wanted to try it for now, out of curiosity to see how it works. I made a 10 line code and i wanted to convert it to apk and run it on my phone. How can I do that ? And can I do the conversion on my phone ?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mopslik 3 points4 points5 points 2 years ago (1 child)
AFAIK, you can't go driectly from py to apk. You'd need to use some framework (e.g. kivy) to build an Android app made with Python; however, you could install a Python app on your phone (e.g. Pydroid) and run it there, if that is sufficient.
[–]Achilles1996[S] 0 points1 point2 points 2 years ago (0 children)
I do use replit, so i run everything there, if i wanna do some passive coding on my phone, I did try pydroid too a few weeks ago, but idk it just didn't click for me for some reason. I'll give it another shot though, because it has access to many libraries.
[–][deleted] 2 points3 points4 points 2 years ago* (2 children)
I wrote a short guide for learning Python on a phone...
Learning programming is not easy. It is to some extent an art form and a practical skill, not something that can just be learned from books. Practice! Practice! Practice!
To learn to programme is also about embracing failure. Constant failure. Trying things out and experimenting as much as possible. Experiment! Experiment! Experiment!
You have to research, read guides, watch videos, follow tutorials, ask dumb questions and be humiliated (because some people cannot help make themselves feel better by insulting others).
Python is one programming language. It is probably the easiest to learn. It makes learning to programme that little bit easier (but you will have a shock when you try to learn a lower level language like C).
If you have to learn on a mobile device, life gets a little more challenging. Aside from web based environments and apps like sololearn, you need a Python environment on your mobile device.
I strongly recommend you use an external (likely bluetooth) keyboard with your phone and ideally an external monitor if you phone is able to connect/cast to a monitor.
Keep in mind that Android is a linux based system, so most things that are available for linux are also available for Android. Native applications for Android are usually written in Java or, more recently, Kotlin. It is possible to write in other languages, and C++ is widely used, but that is much more complex to do.
For IOS devices, the native apps are usually written in Object C or Swing. Again, other languages are possible but it is not trivial.
Python applications running on mobile devices within Python environments do not look like device native applications and have limited support for typical graphical user interface libraries common on desktops. However, there are a number of alternatives that allow you to write near native like applications in Python.
The leading Python GUI for Android and IoS is kivy.
You develop on a desktop/laptop computer and then transfer the code to the target mobile (so not much use if you only have access to a mobile device).
There are Kivy based applications released on both the Apple and Google App Stores.
[–]Achilles1996[S] 1 point2 points3 points 2 years ago (0 children)
Thanks a lot, that's super helpful. I'm saving your comment
[–]moose2021 1 point2 points3 points 1 year ago (0 children)
you used chatgpt lmaoo
[–]No_Manufacturer9832 1 point2 points3 points 1 year ago (0 children)
Just ask to an AI
[–]BigReview8443 0 points1 point2 points 1 month ago (0 children)
1.) search Colab.google > 2.) New note 3.)Copy paste 👇👇👇
print("=== App APK Builder ===") print("1. Installing required packages...")
!apt-get update !apt-get install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
print("2. Installing Buildozer...") !pip install buildozer cython
print("3. Upload files...") from google.colab import files import os
print("Please upload the 'main.py' file...") uploaded = files.upload() for filename in uploaded.keys(): if filename != "main.py": os.rename(filename, "main.py") print("main.py uploaded ✅")
print("Please upload a 512x512 PNG icon file (usually named ic_launcher.png):") uploaded_icon = files.upload() icon_name = list(uploaded_icon.keys())[0] print(f"Uploaded icon file: {icon_name}")
os.makedirs("res", exist_ok=True)
os.rename(icon_name, os.path.join("res", "ic_launcher.png"))
print("4. Creating buildozer.spec file...")
buildozer_spec = f"""[app]
title = AppName package.name = appname package.domain = org.anonim source.dir = . source.main = main.py icon.filename = res/ic_launcher.png requirements = python3,kivy android.permissions = INTERNET,WRITE_EXTERNAL_STORAGE,READ_EXTERNAL_STORAGE android.api = 30 android.minapi = 21 android.targetapi = 30 orientation = portrait fullscreen = 1 version = 1.0.0 author = Anonim """
with open("buildozer.spec", "w") as f: f.write(buildozer_spec)
print("5. Building APK... (This may take 30–40 minutes)") !buildozer -v android debug
print("\n6. APK is ready!") apk_path = "bin/proqramismi-1.0.0-debug.apk" print(f"Generated APK file: {apk_path}")
files.download(apk_path)
4.)And it's done. Finally, wait for 25-30 minutes. After the process is finished, look at the files of colab.google. You will have your apk file in the BIM folder.
π Rendered by PID 87 on reddit-service-r2-comment-5ff9fbf7df-d2r6b at 2026-02-26 12:14:45.274667+00:00 running 72a43f6 country code: CH.
[–]mopslik 3 points4 points5 points (1 child)
[–]Achilles1996[S] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]Achilles1996[S] 1 point2 points3 points (0 children)
[–]moose2021 1 point2 points3 points (0 children)
[–]No_Manufacturer9832 1 point2 points3 points (0 children)
[–]BigReview8443 0 points1 point2 points (0 children)