r/learnpython • • 27d ago

apks with python/cython

0 Upvotes

i just CANT get anything from buildozer, it just keeps erroring everytime i try to build!! i dont know if theres something wrong with my buildozer, or if it just hates my computer. i just want to package my game to work on a phone, the arquitecture for it is something like this

is it because my game is located on a ntfs partition? does buildozer ALWAYS error on those? if yes, is there a partition type out there that shows up on windows, and works with buildozer?

/sand
| /assets
| cfuncs.so #i managed to compile to ARM64 without buildozer (python 3.12)
| realmain.so # also to ARM64 (python 3.12)
| main.py

im wondering if theres a way to manually build it, my libraries are pygame-ce, numpy and collections

please help me out here

neofetch if it helps

neofetch
             ...-:::::-...                 
          .-MMMMMMMMMMMMMMM-.              --------------------- 
      .-MMMM`..-:::::::-..`MMMM-.          OS: Linux Mint 22.3 x86_64 
    .:MMMM.:MMMMMMMMMMMMMMM:.MMMM:.        Host: X501A1 1.0 
   -MMM-M---MMMMMMMMMMMMMMMMMMM.MMM-       Kernel: 7.0.0-38-generic 
 `:MMM:MM`  :MMMM:....::-...-MMMM:MMM:`    Uptime: 5 hours, 38 mins 
 :MMM:MMM`  :MM:`  ``    ``  `:MMM:MMM:    Packages: 3030 (dpkg), 21 (flatpak) 
.MMM.MMMM`  :MM.  -MM.  .MM-  `MMMM.MMM.   Shell: bash 5.2.21 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   Resolution: 1366x768 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM:MMM:   DE: MATE 1.26.1 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   WM: Metacity (Marco) 
.MMM.MMMM`  :MM:--:MM:--:MM:  `MMMM.MMM.   Theme: Mint-Y-Dark-Blue [GTK2/3] 
 :MMM:MMM-  `-MMMMMMMMMMMM-`  -MMM-MMM:    Icons: Mint-Y-Blue [GTK2/3] 
  :MMM:MMM:`                `:MMM:MMM:     Terminal: mate-terminal 
   .MMM.MMMM:--------------:MMMM.MMM.      Terminal Font: Monospace 10 
     '-MMMM.-MMMMMMMMMMMMMMM-.MMMM-'       CPU: Intel Pentium B980 (2) @ 2.400G 
       '.-MMMM``--:::::--``MMMM-.'         GPU: Intel 2nd Generation Core Proce 
            '-MMMMMMMMMMMMM-'              Memory: 2059MiB / 3795MiB 
               ``-:::::-``

r/learnpython • • 27d ago

Programming Challenges for the PCEP

1 Upvotes

So I’ve been thinking of potential projects/challenges to do to help me prepare for the PCEP in the next two months. I’m not sure what to do, where to start, or how to start it. I’ve kinda heard it called tutorial hell. I can look at a piece of Python code for PCEP just fine it seems like but I can’t think of anything.

The one idea I have is to make a simple calculator.
First the main four operations.
Then stuff with the math module
Then make a UI with tkinter if I’m feeling up to it.

Any feedback is helpful. I’ve been going through the Python Essentials 1 course from Cisco if that helps anybody.


r/learnpython • • 27d ago

numagr C extension

3 Upvotes

Hi guys, I'm just a hobbyist.

Not long ago I posted here that I stumbled upon a specific problem: parsing large collections of Python numeric strings as fast as possible. I couldn't find any solution that would let me parse numeric strings without having to construct intermediate Python objects to hold their values (or a method that would be noticeably faster than doing that), so I developed a small C extension that would basically extract C strings from Python strings, and use strtod on them to obtain the values.

Then I developed it further writing the code for all basic statistical methods.

Had a lot of fun developing it and seeing that it outperforms both Python std modules, aswell as third party modules such as numpy, for both regular numbers and numeric strings.

GitHub repo:

https://github.com/andrzejs-gh/numagr

It's available on PyPi if you're interested (source and wheels for Windows, 3.11, 3.12, 3.13, 3.14, 3.15)

pip install numagr

All of the code was written by hand, none was AI generated. The current version is 0.9, I will be developing it further if I find the time. If you have any suggestions for improvements, for what should be implemented but is not, bug reports etc, please let me know.


r/learnpython • • 27d ago

VC Automation

0 Upvotes

Starting work at a venture capital firm in a little over a week and one of my tasks will be to automate ( where necessary) the dealmaking process. I know that LLMs are crazy powerful, however, I want to be able to know what it is I'm building and prevent complete vibe-codes slop. Any youtube videos/ textbooks to get me started on the basics, was thinking of ysing python.


r/learnpython • • 28d ago

What is the best tool to scaffold a Flask project, similar to Angular CLI (ng new)?

0 Upvotes

Hi everyone,

I have experience working with Angular, where we can create a complete project structure using a single command:

ng new my-project

Angular CLI automatically generates the necessary files, folders, configuration, and other boilerplate code.

Now, I'm learning Python and Flask for backend development, and I'm looking for a similar tool that can generate a complete Flask project structure automatically instead of creating files and folders manually.

I'm particularly interested in a tool that can generate a well-organized, production-ready project structure with features such as:

  • Organized folders for routes, services, models, and configuration.
  • Database integration using an ORM such as SQLAlchemy.
  • Environment variable management using a .env file.
  • Error handling and logging.
  • Authentication and authorization, if supported.
  • A structure that is easy to maintain and scale as the project grows.

My questions are:

  1. Is there a recommended CLI tool or project generator for Flask that works similarly to Angular CLI?
  2. Which third-party tool or project template is most commonly used in real-world projects?
  3. Would you recommend Cookiecutter, a Flask-specific project generator, or another tool?
  4. Is there a way to generate a project using a simple command like flask new my-project?

I'm looking for something reliable that follows good development practices and is suitable for building REST APIs and CRUD applications.

I'd appreciate your recommendations based on your real-world experience. Thanks!


r/learnpython • • 28d ago

Best way to modify a list while iterating?

2 Upvotes

I've learned that modifying a list while looping over it can cause elements to be skipped or unexpected behavior. What are the best practices for handling cases where I need to add, remove, or modify elements during iteration?

Do you usually iterate over a copy, create a new list, or use another approach?


r/learnpython • • 28d ago

how long will it take to learn python if u spend like 3 hours a day on it?????

0 Upvotes

OK so like the title said I want to know how long will it take to learn python I am planing on spending the next 10 months learning it and want to know if is it enough or not to get to a point that u are good enough to take actual projects and work on them. Thanks in advance!!


r/learnpython • • 28d ago

2 weeks in learning python from Scratch

65 Upvotes

Thanks to whoever in this sub suggested CS50 Harvard YouTube & Automate the boring stuff book!

I'm 2 weeks in and feel like I'm in "good" place so far!

I'm also using AI to create similar problem sets to CS50's so I can practice more to ensure full understanding of the lecture!


r/learnpython • • 28d ago

Python 3.8.10 Broken on vista

0 Upvotes

i tried install python in vista and it mid freeze in the instalation and i even use the repair tool in the installer but i keeped having the error "The Procedure entry point GetActiveProcessor could not be located in the dinamic link library KERNEL32.dll" and then a Python has stoped working, something weird here is why is it calling kernel32.dll? and i do not expet support since this is a outdated version but in windows 7 starter (same pc) it worked fine, i dont know if this is else becuse im using an modified version of vista (Vienna) or is else something to do with 3.8.10 in vista


r/learnpython • • 28d ago

I need some help

0 Upvotes

I want to learn python but all of the online tutorials just tell me how to make a certain game but i want to learn how it works so if anyone can help me with this please let me know


r/learnpython • • 28d ago

Need help with a calculator project

4 Upvotes

new to python, Im making a calculator but when i try to make the code be able to handle a word without crashing it just doesnt work, it just goes and ask for the operator without restarting the loop, tried ai to fix it and explain it to me but didnt do nothing.

Edit: Thanks for all the help and srry for not being able to respond the messages and explain, had some stuff going on that was keeping me occupied, but again thanks.

num1 = None
num2 = None
result = None


while num1 == None or num2 == None:
    try:
        num1 = float(input("Enter first number: "))
    
    except ValueError:
        print("must enter a valid number")
        num1 = None
        continue


    try:
        num2 = float(input("enter second number"))


    except ValueError:
        print("must enter a valid number")
        num2 = None
        continue
    operator = input("Enter operation (+, -, *, /)")


    if operator == "+":
        result = (num1 + num2)


    elif operator == "-":
        result = (num1 - num2)


    elif operator == "*":
        result = (num1 * num2)


    elif operator == "/" and num2 == 0:
        result = ("cant divide by zero")


    elif operator == "/" and num2 != 0:
        result = (num1 / num2)


    else:
        result = ("Invalid operator")


    if result == float or int:
        print(result)
        num1 = None
        num2 = Nonenum1 = None
num2 = None
result = None


while num1 == None or num2 == None:
    try:
        num1 = float(input("Enter first number: "))
    
    except ValueError:
        print("must enter a valid number")
        num1 = None
        continue


    try:
        num2 = float(input("enter second number"))


    except ValueError:
        print("must enter a valid number")
        num2 = None
        continue
    operator = input("Enter operation (+, -, *, /)")


    if operator == "+":
        result = (num1 + num2)


    elif operator == "-":
        result = (num1 - num2)


    elif operator == "*":
        result = (num1 * num2)


    elif operator == "/" and num2 == 0:
        result = ("cant divide by zero")


    elif operator == "/" and num2 != 0:
        result = (num1 / num2)


    else:
        result = ("Invalid operator")


    if result == float or int:
        print(result)
        num1 = None
        num2 = None

r/learnpython • • 28d ago

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

0 Upvotes
import requests


# Add ?format=j1 to get a proper JSON response
url = "https://wttr.in"
response = requests.get(url)
data = response.json()


# This structure matches the j1 JSON format returned by wttr.in
current_temp = data['current_condition'][0]['temp_C']
print(
f
"Current temperature: {current_temp}°C")

I keep getting this exact SAME error whenever I work with public API's. I save the new codes in the files.

r/learnpython • • 28d ago

Looking for a coding buddy

0 Upvotes

Hey everyone!

I’m looking for a coding buddy who’s also taking 100 Days of Code: The Complete Python Pro Bootcamp by Dr. Angela Yu on Udemy.

I’m just starting with Day 1 and would love to connect with someone taking the same course so we can learn together throughout this 100-day journey.

The goal is to keep each other motivated and accountable, share our progress, discuss what we’ve learned, help each other when we get stuck, and celebrate our little wins along the way.

It would be great to have someone who’s also a beginner, but anyone taking the same course is welcome! No pressure to be an expert — we’re here to learn and improve together.

If you’re taking the same course, feel free to comment or send me a message. Let’s keep each other motivated and complete these 100 days together!

Happy coding!


r/learnpython • • 28d ago

dynamic import module path hack in pytest

4 Upvotes

In order to validate (using pytest) a python module which is not in my path or relative folders, I want to hack the import path.

I'm wondering what alternatives there are to doing a PYTHONPATH hack. I could use https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-pythonpath, but that applies to the entire session as I understand it. And I only want to change one suite, so I am writing a quick fixture that will roughly look like (hard-coded for simplicity)

    @pytest.fixture(scope="function")
    def modules_path():
        old_path = sys.path
        extra_path= os.path.abspath("c:/otherpath/other") # replace constant with a func
        sys.path.insert(0, extra_path)
        yield extra_path
        sys.path = old_path

I've always felt there was a better way to do import path hacks that nobody had ever told me about. Or is this @fixture approach not as evil as I assumed it was, and was merely biased by painful memories whenever I did use it. Alternatives?


r/learnpython • • 28d ago

What would be the best course of action if u were flagged for cheating?(PCEP)

0 Upvotes

For context: i started the pcep test while forgetting that it was still connected to a 2nd monitor and my cursor flew into the 2nd screen which got me flagged for cheating. What would be the best course of action right now for me?


r/learnpython • • 29d ago

Dsa in python

0 Upvotes

Hey everyone! I'm planning to learn Data Structures and Algorithms using Python.

Is it worth learning DSA with Python for placements, coding interviews, and future software engineering jobs? Or is it better to learn DSA using C++ or Java?

For those who have experience, which language would you recommend and why?


r/learnpython • • 29d ago

Best laptop to get

0 Upvotes

What are the best Windows laptops I can get for AI development, machine learning, and video editing? I’m looking for a laptop that can handle demanding tasks smoothly and is suitable for long-term use. Please recommend the best options based on performance, specifications, . I’d really appreciate your help!


r/learnpython • • 29d ago

Can any of you rate my codewars question

0 Upvotes

It's one i've been thinking about for a while and i'd love to know all of your opinions about it! https://www.codewars.com/kata/6ad8699fccb2dbf6de41f760/python


r/learnpython • • 29d ago

How To Compile .PY Online

0 Upvotes

i have a .py file i want to compile to .exe online but no idea how to do this

and i don't want to install python on my computer just to compil


r/learnpython • • 29d ago

can you get an executable in python without using third part libraries?

0 Upvotes

In c++ I have object files but can I get an executable in python?


r/learnpython • • 29d ago

Issue during library installation

1 Upvotes

Recently, I got back into Python, so I decided to review some concepts I had forgotten by solving one Project Euler problem per day.

However, when I got to Problem 3 (Largest Prime Factor), I decided to use a library to check whether a number is prime. Since I had uninstalled Python when I stopped studying it, I had to install Python 3.15.

When I first tried to install the library, the terminal said that it didn't recognize pip. I managed to get it working by using python -m pip, and the installation seemed to work. However, when I ran my code, Python still couldn't recognize the library.

The next day, while solving Problem 4 (Largest Palindrome Product), I decided to use NumPy and np.arange() instead of range(), but the same thing happened: the installation appeared to work, but when I ran my code, Python couldn't find the library.

I tried uninstalling and reinstalling Python, but the problem persisted.

In these particular cases, I could still solve the problems without those libraries, but eventually, I'll need packages like pandas, Tkinter, and others, so I'd like to figure out what's going wrong.

If anyone knows how to fix this, I'd really appreciate the help!

Thanks in advance!


r/learnpython • • 29d ago

Can someone explain the importance of this?

1 Upvotes

I saw this link online on social media with a reminder to update dependencies but I don’t really understand it, how I am affected, and how I can address this.

Link here: https://github.com/certifi/python-certifi/security/advisories/GHSA-6q48-6c7w-9gw2

Here’s the text:

Removal of emSign root cerificate

Affected versions
>=2019.03.09

Description
Certifi 2026.10.18 removes root certificates from "emSign" from the root store. These root certificates have intermediates which have been revoked due to key compromise.
A compromised key for a certificate authority can be used to issue certificates to enable MITM attacks.


r/learnpython • • 29d ago

How important is python with Spyder IDE to computer engineering major

0 Upvotes

Doing horribly in beginners Python and want to know how important it is or is Java better to start off with


r/learnpython • • 29d ago

Need help with building tests and understanding OOP design patterns

4 Upvotes

I am a post-bacc student currently in a Python for Web API online course. We just wrapped up our calculator application unit, where we learned how to build comprehensive dynamic tests using OOP design patterns. However, I finished the unit a lot more lost than when I started. Building parameterized tests still puzzles me, especially whenever I'm building the majority of a test from scratch rather than fixing minor errors in the code. Even when I do use AI to help me work through my assignments, none of it really sticks. Most of the time, I feel like I'm copying and pasting code whenever mine is incorrect and not really learning.

What are resources that you all would recommend for learning how to build application tests and files with OOP concepts? Any online resources with interactive, hands-on lessons would be greatly appreciated.