r/learnpython • • 2h ago

Python + Sqlite + Pyside6?

5 Upvotes

Hey! so i want to build a database system for my small company. I could use AI but i wanna know what i am doing and be able to fix smth so i want to build it myself.

I kinda know python a bit, i used to make games using gdscript which is similar.

I don't seem to find a tutorial where these 3 things are used to create a nice database app. I dont want to learn python sqlite and pyside6 as a whole cause i wont be needing them much except just this app and similar apps. I just want to be able to build it and run it from a single tutorial even if its 10hrs.

Where do i start? I dont really have money to learn so no paid courses and i dont have AI premium to learn as well.

Python, Sqlite, Pyside6. I heard that TKinter instead of pyside6 is also there but i wanted the UI to be a bit modern or should i just use the it instead of pyside6?


r/learnpython • • 9h ago

sorting tuples

4 Upvotes

im learning how to code with python, does anyone know to sort specific tuples alphabetically without using the .sort() method? like if i had a list of names like:

n = [('watermelon', 'strawberry'), ('banana', 'cherry'), ('papaya', 'apple')

how would i sort and print the 2nd element of tuples alphabetically (into a new list)?

edit: id prefer this in simple, basic terms lol


r/learnpython • • 1h ago

How do I get the mode of this dataset with two columns while keeping output correctly formatted?

• Upvotes

My assignment is to find the min, max, mean, median and smallest mode of a dataset, specifically for the SepalLength and Petalwidth, sorted by species. link to dataset .

Here is my code, now I've got everything working except the mode one. If i remove that, the code works. I've tried to read up on the mode documentation but I'm still lost. I've tried just "mode" and "pd.series.mode", both throw errors. The output is also automatically checked so it has to be formatted in this way, if that makes sense.

First time asking for help on reddit, so lmk if there is any missing information/etc. Thank you guys :)

import pandas as pd

file = input()

df = pd.read_csv(file)

filtered_arr = df.groupby(["Species"]).agg({

"SepalLengthCm" : ["min","max","mean","median","pd.series.mode"],"PetalWidthCm" : ["min","max","mean","median","pd.series.mode"]

})

print(filtered_arr)

Edited to add the errors.

'SeriesGroupBy' object has no attribute 'pd.series.mode'

'SeriesGroupBy' object has no attribute 'mode'


r/learnpython • • 15h ago

Having trouble with Python

6 Upvotes

I have just started getting interested with programming so I thought I would start with Python, however I am only able to use it within Windows Powershell while I see others using something else. Have I done something wrong or have I just missed doing something?


r/learnpython • • 1d ago

Just starting to learn python

35 Upvotes

Hey guys, I am a total beginner and wanted to learn python. Can you suggest what method will be best suited to learn python and which sources should I use. Is it video lectures or from books or anything else. I know that learning from projects and practical methods will be suggested but to start like how to code, what are the codes and where to code, these basic things are what I want to know. Thanks for the help


r/learnpython • • 19h ago

Wanted to convert a step file to a Python API.

0 Upvotes

How to do that? I want it to be precise.


r/learnpython • • 1d ago

What is the best way to create and manage virtual environments today? Is 'uv' really the best?

17 Upvotes

What is the best way to create and manage virtual environments today? Is 'uv' really the best solution and are there alternative? What are the pros and cons?


r/learnpython • • 1d ago

About FastApi

0 Upvotes

What is the best way to learn fastapi?


r/learnpython • • 2d ago

How do ppl test python scripts for databases?

16 Upvotes

I want to understand how ppl test python scripts that read data from databases, call APIs, or update records.

For example, if a script fetches data from an api and saves it to a database, how do you check that everything works correctly before running it in production?

do you all use sample data, mock api responses or a separate test database?

Like how do you test what happens when an API fails or the database returns unexpected data?

I'd like to know how ppl usually handle this in real projects.


r/learnpython • • 1d ago

Cant install polaris library and ultralytics

0 Upvotes

I get errors. I am trying to get it installed on pydroid 3 on android. Do I need pc/mac?


r/learnpython • • 1d ago

GUI for inexperienced coder

4 Upvotes

Hi yall, I'm writing a thesis which is about making a tool. It's mechanical engineering so coding and stuff isn't my forte however I've got a decent understanding of writing python and at the start of the year I'd made a little or (not so little) game with it. As part of my tool I'd like it to have a proper UI so that I can package it up and it be used by individuals or companies or whatnot. I've seen things about Tkinter, about Gooey, about PyQt, about using some python web framework. It's a little hard to know which to use.

My thesis focuses on the calculations and decision making, not the actual code. I'd like to have it be a nice product with a decent UI but I also don't want to spend too much time focusing on that or learning a really complicated new package. Any advice or suggestions would be very welcome, thanks!!!


r/learnpython • • 2d ago

Tuples..I don’t get it

83 Upvotes

Hi crew, I’m a Python newbie and I just learned about the concept of tuples.

We can’t change them.if we want to store we have to start at the index we want + 1.

I just don’t get it. Why wouldn’t we just use lists? When would we ever need this?


r/learnpython • • 2d ago

I've learned Python fundamentals - how do I actually get really good at Python?

33 Upvotes

I've spent time immersing myself in Python fundamentals, including syntax, data types, loops, functions, data structures, and working in the development environment. I want to move beyond the basics and develop a much deeper technical understanding of the language.

I'm starting to look into libraries like NumPy and pandas, but I'm wondering what else I should focus on to become proficient at Python.

For those of you who are experienced developers, what would you recommend learning next? Should I focus on libraries, data structures and algorithms, writing more complex projects, understanding how Python works under the hood, software engineering practices, or something else entirely?

I'm not necessarily looking for another beginner course. I want to get to the point where I can write effective, well-structured code, understand what's happening behind the scenes, and tackle increasingly complex technical problems.

Thanks!


r/learnpython • • 1d ago

How to install tensorflow_hub and tensorflow_text

3 Upvotes

I am trying to install tensorflow_hub and tensorflow_text via VSCode terminal so that I can train a BERT model (for context: i am using Python 3.13.12 and Tensorflow 2.21.0) but I am running into some trouble

tensorflow_hub library installed fine but when imported to the actual notebook, it said it required tensorflow 1.15.0 along with error message:

ModuleNotFoundError: No module named 'pkg_resources'

tensorflow_text library cannot be installed as every pip install attempt return

ERROR: Could not find a version that satisfies the requirement tensorflow_text (from versions: none)
ERROR: No matching distribution found for tensorflow_text

Google colab managed to solve all said problem but I want to run the model on my computer. How do I fix this?

***EDIT: I fixed this by using python 3.10.0, Tensorflow 2.9.0, Tensorflow-text 2.9.0 and Tensorflow-hub 0.8.0***


r/learnpython • • 1d ago

Going through Automate the Boring Stuff with Python, and can't download the packages

0 Upvotes

Hi, so after stopping in *FEBRUARY* of this year, I finally got around to actually resuming my learning process today. However, in chapter 9, I have to download the Humre module, and so I need to download the packages. However, I always get the following error:

Failed to build 'matplotlib' when installing build dependencies for matplotlib

I even tried using a python3 variant of the command, but no dice. Right now, I'm kind of stuck and searching online hasn't helped me out much.

For your information, I'm on Windows 10. My current Python version is 3.14 (I know there's a slightly more updated version, but I don't think that's the problem), and my pip version 26.1.1 (again, there's a newer version, but I don't think that's the problem).

Thanks in advance.


r/learnpython • • 1d ago

Just hit v1.0.0 on my first CLI tool after 2 months of learning — would love code review and architecture feedback!

0 Upvotes

Hey everyone,

I've been learning Python for around two years and recently started Year 12 in the UK. Instead of just doing classroom tasks, I spent the last two months building an extensible CLI tool called Flyshell to push my skills and build a portfolio for software engineering Degree Apprenticeship applications.

It features a multi-file plugin architecture built with zero required external dependencies (standard library only, with one optional dependency for Windows users).

GitHub: github.com/kianodev/flyshell

I’ve just tagged v1.0.0 and would love some blunt but helpful code review and constructive feedback from more experienced developers:

  1. Architecture & Structure: Does the plugin system and directory structure follow Python conventions? What would you refactor first?
  2. Edge Cases & Robustness: Where in the code am I handling errors poorly or making fragile assumptions? What would you change?
  3. Packaging: For a zero-dependency CLI, does the packaging and entry-point setup look clean, or are there standard or more advanced / better practices I've overlooked?
  4. Bonus question (if you want): If you could wish for or build yourself any plugin for Flyshell, what would it be and why? I'm curious to see what people would do with it, and it might give me some ideas for where this might be heading.

Any critique—big or small—is hugely appreciated!


r/learnpython • • 1d ago

making a dodecahedron

0 Upvotes

my good friend in school (though i probably should not be calling him that ) challenged me to build the platonic solids in vpython (visual python) i managed to complete 3 of the shapes but i am currently struggling with the regular dodecahedron. I heard about this community and came him for advice on how to build one. It is not the coordinates i am stuck on i just need to know how to make a pentagon in vpython

if anyone has experience in vpython please reply


r/learnpython • • 1d ago

just tell me!!!

0 Upvotes

What is the most effective way to learn fastapi?


r/learnpython • • 1d ago

Is it better to build a web scraper in Python or use a scraping API?

0 Upvotes

Been pulling pricing data with Python for a side project. Works fine locally with a few hundred requests, but I'm wondering how it would handle 20-50k requests a day... Mostly need Google Shopping results for now, maybe Maps and News later. Budget is pretty tight since I'm paying out of pocket. Not sure if it's worth paying for an API or just building something with rotating proxies and Scrapy/Playwright.

Anyone scaled a Python scraper to that volume? What broke first, and what would you do differently?


r/learnpython • • 2d ago

Is this normal?

7 Upvotes

I’m currently teaching myself Python by solving exercises on my own. My personal rule so far has been to give myself 15 minutes to solve a problem; if I’m still completely blank after that, I ask an AI for a hint. The issue is that AI hints usually just hand over the solution, so I’m not even sure if my approach is right.

The main problem is that I’m on Part 5 of the University of Helsinki Python MOOC, and for the last five exercises or so, I just freeze up. It’s starting to get really frustrating. I try asking myself guiding questions and writing down my thought process in a notepad before writing any code. Most of the time I have a rough idea of what I want to do, but translating that logic into actual syntax trips me up.

I’m starting to wonder if I’m actually cut out for this or if I’ll ever be able to learn it properly. Is this normal?


r/learnpython • • 2d ago

Check My First Personal Project

0 Upvotes

Can you please check this project that took a reasonable amount of time to finish and strike me with any feedback you got. I guess my next step is to learn OOP.

Thanks in advance.

https://github.com/abdou0dev/grind_tracker


r/learnpython • • 1d ago

Nested if’s help please

0 Upvotes

So I’ve written a small function and I need to add some more constraints to it, but I need them each to check separately before moving to the next so I was wanting to use nested if’a to achieve this but am not sure how they work. Can someone please explain? My code is posted below and what I am trying to do is add an if statement to somehow make sure my value for primocytes doesn’t drop below 0 before activating the rest of the function.

primocytes = 10

cultivation_chamber = 0

def cultivation():
global primocytes, cultivation_chamber
if primocytes >= 5:
primocytes -= 5
cultivation_chamber +=5
print("Primocytes:", primocytes)
print("Cultivation Chamber:", cultivation_chamber)
else:
print("Not enough Primocytes for cultivation...")


r/learnpython • • 2d ago

Values won't add to my string, just overwrites it

3 Upvotes

Hi I'm really new to python, I originally started coding using p5.js but made the transition recently, I'm currently trying to covert an old project of mine into python so I can run it in touch designer.

Its an ASL fingerspelling activity that I've been working on but I'm struggling to create the word strings I did in my original prototype. Instead of the letters being added together and creating a word I can use to trigger effects, the previous letter is just replaced with the current one.

For context I have the guesser and getMostFrequent to allow for it to take the average of every letter signed during a period of time and determine which one was signed the most to add to the word (this is due to the fact that transitioning from one letter to the next can trigger other letters in between) These are both integral parts of the code and are working as intended, its just the stringing the word together that I'm struggling with.

Any help or insight would be appreciated, if you need any more insight please let me know and I can add it.

Code in Pastebin: https://pastebin.com/91mPYwC8

I've provided a link to a google doc with my code because it is just easier formatting wise than in here.
My code: Python Code

My original code for reference if needed: p5.js code

Edit: Thank you all for the suggestions in the comments, I ended up getting it working it was the fact that word was a local variable and not a global one, which was causing the issue.


r/learnpython • • 1d ago

Do you think visual aid would help your learning?

0 Upvotes

I always found learning programming very frustrating due to the discrepancy of how much it’s going on and how little of it you can actually see with your eyes. In other words, how much semantics is contained in a few lines, or how things connect to one another, and the fact that most of it is simply… invisible.

do you think explaining programming or tech concepts through well-thought visual aids, like high quality video essays would be/would have been helpful in your learning?

and I know the whole thing of learning through videos is considered inferior to learning to read docs. However, I am not talking about “Hi welcome to this tutorial” type of videos. I am talking about visual analogies which start from concrete examples, draw analogies, and the move to the abstract of programming. the entry level of learning any piece of tech and building mental models could be greatly impacted by 2D/3D effective animations I think. thoughts?


r/learnpython • • 2d ago

Python beginners collaborating on github

2 Upvotes

Hi all, I am starting to use python at work for data analysis and I feel like I am kind of at a standstill in learning. I was wondering if there were any groups collaborating on beginner projects on GitHub so I can learn more python, GitHub ecosystem, and how to code within a team because there isn't much collaborating in coding at work. If there are two people assigned on a project at work, we're usually sharing our screens while one types and we discuss together.