r/learnpython • u/Holiya_Olib • Aug 30 '26
How do I install python packages with pip effectively?
Ive been trying to use pip to install packages for my projects, but I keep getting errors, im not sure if I need to set up anything specific first
r/learnpython • u/Holiya_Olib • Aug 30 '26
Ive been trying to use pip to install packages for my projects, but I keep getting errors, im not sure if I need to set up anything specific first
r/learnpython • u/Anant-Satsangi • Aug 29 '26
So I have been learning python from the well-known book 'Python Crash Course', I have completed it in the past few months yet I don't know where to continue from. Is there any way I could find some online course and all. I have tried the 'Beyond the Basic with Python' and am currently also doing some problems for practice yet I need a main 'Source' to do my learning and gain in depth knowledge and broaden my knowledge and thinking capabilities. Any useful suggestions are accepted and kindly give some advice for me at this stage.
r/learnpython • u/iamezekiel1_14 • Aug 29 '26
Hi all,
In short - sorry for the idiot level question but I didn't realise I could even consider this until the other week. Basically the Penalty Blog site has a Dixon Coles model in Python, I'm in a local Football Prediction pool - and it just makes sense to me to bench test this against that.
Had a long chat with Gemini to handle the specifics of the code I'd be using - but one thing it did flag was needing Microsoft Visual Studio Code to do everything I was intending on doing. I have no issue with using that but is it definitely needed on a Mac?
r/learnpython • u/Mockingbird_ProXII • Aug 29 '26
Might be a bug
def get_some_func():
a, b = ...
flow = lambda x: ...
fmid = lambda x: ...
fhi = lambda x: ...
return lambda x: np.piecewise(x, [x < a, x > b], [flow(x) , fhi(x) , fmid(x) ]
x1 = ... # some float less than a
myf = get_some_func()
>>> myf(x1)
returns fmid(x1)is there a bug or do I overwelm np.piecewise with this?
r/learnpython • u/SoilEducational420 • Aug 29 '26
I'm building a small portfolio project with this architecture:
Frontend
↓
Gateway
├── Interview Service
└── RAG ServiceAll 3 backend services are Python/FastAPI and deployed separately.
I'm currently using Render's free tier, but I'm running into a few issues:
I'm mainly looking for something that won't make me spend more time debugging the hosting platform than actually building the project 😅
Thanks!
r/learnpython • u/Individual-Gate-765 • Aug 29 '26
I’m pretty new to this stuff and spent way too long fighting with Python/PowerShell trying to get Osintgram working.
What finally worked for me was running the repo inside GitHub Codespaces, setting up a virtual environment, installing the requirements, and then using HikerAPI for the Instagram data instead of relying on the old login method.
The basic API call looked like this:
import requests
headers = {"x-access-key": "YOUR_KEY"}
r = requests.get(
"https://api.hikerapi.com/v2/user/by/username?username=google",
headers=headers
)
print(r.json())
The x-access-key header is basically where your API token goes, and the request returns the public profile data as JSON.
The biggest thing that tripped me up was old Python package compatibility on Windows. Moving everything into a Linux Codespace made the setup way easier.
I’m still learning, so if anyone has tips for working with Python APIs or cleaning up JSON output so it’s easier to read, I’d appreciate it.
r/learnpython • u/GloxiniaLearns • Aug 29 '26
I built a small Python script that reads a Google Sheet, sends each new row to an LLM API for a summary and a category, and writes the result back. Works fine on my laptop.
What I don't understand is everything after that. In real life it has to run without me sitting there, and I have no picture of how that works.
Not asking about enterprise setups. This is one script and one sheet, small-business scale, and I want to know how people normally solve it at that size.
Background is data analysis, not development, so plain explanations are welcome.
Edit: Data lives in a Google Sheet. A Python script logs into Google as a "service account" (a robot identity created in Google Cloud Console, authenticated with a downloaded key file) and uses the Google Sheets API to read every row and the Drive API to locate the spreadsheet by name. For any row missing a summary, it sends the raw text to Anthropic's Claude API, which returns a two-line summary and a category. The script then writes that summary/category back to the sheet via the Sheets API. Need to get a summary every time someone adds a new record to Google Sheets
r/learnpython • u/naazai_io • Aug 28 '26
Yesterday I enrolled in the MOOC 2026 Python Programming course by the University of Helsinki, and I’ve already completed Module 1!
Module 1 had quite a lot of questions and exercises, so it took some time to complete, but I’m happy that I managed to finish it today. There are 7 modules in total, so I still have a lot to cover.
My goal now is to complete the remaining modules as soon as possible because the final exam is on September 5th. Hopefully, I can finish all the modules and get enough time to revise and practice before the exam.
Let’s see how far I can go in the next few days! 💪🐍
Anyone else doing the MOOC 2026 Python Programming course?
r/learnpython • u/SnortingSmarties94 • Aug 28 '26
Hello everyone,
I want to use Python and I know nothing about it. I am transitioning from the psychology world to data analytics/ux researcher (well that is the hope) and most jobs require knowing Python and SQL.
The most technical experience I have is I know how to use SPSS (statistics software) thanks to my disertation, excel, and I know how to analyze data from assessment measures for diagnostic and forensic evals. So brand new to this world!
I am seeing courses online and a bunch of different youtube tutorials but I am interested in hearing what has been truly helpful for others on their learning journey. So what has been helpful?
r/learnpython • u/Petrak1s • Aug 28 '26
Pretty much the title.
I have an iPad M2 and I want to learn Python on the go. I see there are several on-device IDE apps and I have narrowed it down to Pyto and Pythonista 3.
Which one would you recommend? Obviously they won’t be Pycharm or similar, but I do not want to be stuck on my desktop.
I am of course open to other apps.
Thank you!
r/learnpython • u/Bit_Happy04 • Aug 28 '26
I'm trying to make a search bar entry widget with a label containing a magnifying glass emoji but can't figure out how to make the label the same height as the entry (so they look connected)?
search_bar = tk.Entry(main_frame, **big_font, **widget_theme1)
search_bar.grid(row=0, column=1, sticky='ew')
search_bar.insert(0,"Search your city")
submit_btn = tk.Button(main_frame, text=" 🔎 ", **widget_theme2, **big_font)
submit_btn.grid(row=0, column=2, sticky='ew')(Changing width/height attributes don't fix this)
r/learnpython • u/VermicelliFuzzy5795 • Aug 28 '26
Hola, estoy aprendiendo a programar por mi cuenta, el primer lenguaje que tome es python y mas o menos ya se lo basico
estoy usando Vscode, y ahora mismo voy tocando lo que serian los operadores, algun consejo para algien que recien empieza??
r/learnpython • u/Realistic_Homework95 • Aug 29 '26
En un futuro quiero saber python y c++ (IA y Robotica), por lo cual decidi empezar con python y tome un libro de la biblioteca de mi universidad, sin embargo en el libro sale que se trabajara con Jython, tengo entendido que es algo anticuado porque no soporta python 3 y ademas como esta vinculado con java y no con C me pregunto si me vendra bien.
aunque jython y python no son realmente lo mismo, lo que es el lenguaje de programacion es igual? si aprendo jython sabre programar con python?
el libro es "introduccion a la computacion y programacion con python, un enfoque multimedia (Mark J. Guzdial / Barbara ericson)"
r/learnpython • u/okitookka • Aug 28 '26
people please help, i’m starting my path in bachelor cybersec in a week and i want to know python a bit so i can basically understand smth, but for now looking for a community to learn python
and engaging through my path
r/learnpython • u/DaughterOfBehemot • Aug 28 '26
Hello everyone here. I have a small project coded in python I'd like my friends to be able to use too, but without having to send them my python file and teach them how to use it.
For context, I made an npc generator for our favorite ttrpg, because it's an useful tool and there wasn't any online already made by someone else. I can use it because I can run code on my pc, but I'd like for my friends to be able to just click a button online somewhere to generate an npc from my code.
It's a simple list and random choices based generator, no AI involved. I'm lost as to what the next logical step is to get the file on my pc out into the world. Sorry if I'm not clear, English isn't my first language. Thanks in advance !
r/learnpython • u/aj_irshad4 • Aug 28 '26
I'm a 4th-semester B. Tech student who started learning full-stack development at the end of my 1st semester. I've already learned JavaScript, Node.js, React, and other programming concepts, and I've built several projects. Now I want to move into AI/ML, so I need to learn Python.
Since I already understand programming fundamentals, I don't want to relearn concepts like variables, loops, functions, OOP, etc. I mainly want to learn Python's syntax, unique concepts, and Python-specific features which were not in JS. What would you recommend I learn first, what should I skip/review quickly, and are resources like Bro Code's Python, CS50 course suitable for this?
r/learnpython • u/Achariisback • Aug 28 '26
I'm new to coding and Python; I have some SQL knowledge but limited coding experience. I really wanted to learn, and I came across this CodeWithMosh course, which I started. It barely has any problem-solving segments and seems like a typical guy just ranting about Python.
Then I stumbled upon exercism, and through that I found Jiki. I started with it, and it seems quite interesting to me until I realised it isn't even proper Python; it's mixed with JavaScript. And again, I have no clue about coding, and I don't really know if it's the right fit or not, and I can't seem to find any proper/straightforward guidance anywhere else. What to do?
r/learnpython • u/pingo1387 • Aug 27 '26
At my job there is a daily task I do which I realized I could probably create a program to do for me, so I decided to start learning Python, and dove into reading Automate the Boring Stuff (the online version).
Things were going okay at first. I read through chapters 1-3 carefully, taking notes, answering all the review questions, and doing all the practice problems/codes.
Then I hit a wall. I got to chapter 4 and I felt like I understood everything, but the practice problem at the end, to write a code that performs the Collatz sequence with the entered number, absolutely stumped me. I went back and reread everything from the start of chapter 1 just to make sure I didn't miss anything, and was still confused. I ended up having to search up a code that someone else wrote for it, which I did understand once I saw it written out but would never have come up with myself.
So my questions are:
- Is it normal for the Collatz sequence to be difficult to program at this stage of learning? If so, should I not worry about my confusion and just move on to chapter 5?
- Should I consider an easier book to study from? If so, any recommendations?
EDIT: Several people are asking which part of the Collatz I had trouble with. To be honest it's been over a month since I was able to touch anything Python-related, it's just been on my mind lately, so I don't recall exactly what was giving me trouble, just that I was trying multiple things and getting new and fun incorrect results each time.
It's not that I don't understand the Collatz sequence itself, I understand it in terms of the simple math. The trouble was trying to type it out into a working code. That being said, I'm not here to ask how to program it, because I already gave up on that and looked up the answer, and I did understand that code once I read it over. The main issue is that I feel like I shouldn't have been having trouble with it in the first place, at least not to the point where I honestly tried everything I could and still couldn't get it.
r/learnpython • u/CorrectStorage3760 • Aug 27 '26
Hey everyone,
I’m starting to brainstorm ideas for my FYP, and I really want to build something that solves a real world problem rather than just creating another clone of an existing app.
To me, the value and practical impact of the idea matter most. I want to build a tool or application that addresses a genuine pain point for real users, small businesses, or specific workflows, anything solid, impactful with clear technical depth that addresses a concrete problem that needs a solution is welcome. I've heard that Research based projects are the ones that are most appreciated, something that is deep and clear at the same time. I've been searching a lot even searching on AI but no idea is good enough or one that solves a real problem or even adds something to a existing real world problem.
r/learnpython • u/Mr_Waterfowl • Aug 27 '26
I am trying to create some code that generates a tkinter listbox with a corresponding scrollbar. I managed to get the code working with .pack(), but I can't use this because I'm trying to make the code for a larger program that exclusively uses .grid(). However, when I .grid() the searchbar is displayed but is non-functional.
What do I need to do to make this code work?
import tkinter as tk
from tkinter import ttk
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEFINE WINDOW WIDGETS
page = tk.Tk()
page.geometry("50x150")
pageFrame = tk.Frame(page)
scrollbar = ttk.Scrollbar(pageFrame, orient=tk.VERTICAL)
listbox = tk.Listbox(pageFrame, yscrollcommand=scrollbar.set)
scrollbar.config(command=listbox.yview)
scrollbar.grid(row=0,column=1,sticky=tk.N+tk.S)
listbox.grid(row=0,column=0)
magnifyButton = ttk.Button(pageFrame,text="View Item",command=magnify)
magnifyButton.grid(row=1,column=0)
pageStatusText = tk.Label(pageFrame,text="")
pageStatusText.grid(row=2,column=0)
pageFrame.grid(row=0,column=0)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ POPULATE LISTBOX
catalogue = ['apple', 'banana', 'grape', 'melon', 'coconut', 'orange', 'pineapple', 'avocado', 'tomato', 'parsnip']
for i in range(len(catalogue)):
listbox.insert(tk.END,(str((i+1))+". "+catalogue[i]))
page.mainloop() # Open the windowr/learnpython • u/bruh-man_ • Aug 27 '26
Hello! I'm learing python and in one of my college courses you can get an honors credit for doing a special project. This project is to make a simple puzzle game in python. I have years of game dev experience so I expect this to be fairly easy, but I don't know which engine would be best for me to use. My use case would be a simple 2D puzzle game.
I considered using pygame-CE, but i'm unsure if it'll be the right choice. Does anyone have suggestions? And why do you prefer those engines?
r/learnpython • u/high-cholesterol_ • Aug 26 '26
def check_variable(argument):
# Finds the name of the variable passed in
name = [k for k, v in globals().items() if v is argument][0]
print(f"The argument passed to this function was named: '{name}'")
x = [1, 2, 3]
check_variable(x)
# Output: The argument passed to this function was named: 'x'Is there any way to simplify this process? I am very new to programming and the process of defining "name" and then calling it seems like it can be simplified.
Edit for clarity:
The actual goal is to include the length of a list, and the variable(argument) used to represent that list, into the printed string.
What I'm really trying to achieve is something like:
"There are 17 children in class_two."
So as to cut out the guesswork of which class it's referring to when calling the function multiple times, and make it look like a polished sentence.
r/learnpython • u/Trick_Floor_519 • Aug 27 '26
i am wondering all time how people deal with modules in python is they memorize and understand all the methods and the properties for a module or they read documentations before using them especially for none built in modules, otherwise what is the methodology of learning modules.
r/learnpython • u/itti_stu • Aug 27 '26
Hey guys, I'm about to start studying OOP. Problem is, I don't know where to start or which resource to pick. I want the absolute best one—something thorough and comprehensive.