r/pythonhelp • • Aug 27 '26

Why do I need to use classes

2 Upvotes

My schoolbook says that classes is a way of simulating an object, instead of just taking information into a black box and outputting an answer.

But that is a poor explanation. I know classes are handy and cool, but no book says why you can´t make functions with sub functions inside to simulate simple objects. I would like if someone gave a good concrete reason to use classes in the intro, instead of just saying that they are different and cool


r/pythonhelp • • Oct 16 '26

why does python make sense in tutorials but not in actual coding

6 Upvotes

I'm a first year student learning Python rn and I swear everything makes sense when someone explains it but the moment I try to solve a question on my own, my brain just stops working is this normal in the beginning or am I missing something? how did you guys get better at solving problems without looking at the solution??


r/pythonhelp • • Dec 20 '25

Question about python on raspberry pi

3 Upvotes

I've been considering getting a raspberry pi for python. I would just do this on my phone but I can't have projects that use files like JSON and before I got one I wanted to know if you could on the pi


r/pythonhelp • • Feb 03 '26

I am learning program I am a total biggner I am learning totally from start can anyone share some tips

0 Upvotes

Can anybody share some tips about python or overall programing


r/pythonhelp • • May 29 '25

How do I make games with Python??

2 Upvotes

I’m learning Python right now and when I get better I want to start making games and put them on Steam. There’s just one problem, I have no clue how or where to start.


r/pythonhelp • • Mar 19 '26

Need to turn a .py into a .exe

24 Upvotes

Hello, I am trying to turn a .py file into a .exe file with auto-py-to-exe so I can share it with my work colleagues that do not have python. The code is very simple, 30 lines of code and it only import 3 libraries: pandas, pathlib and openserver. It also does not do nothing very complex, it just retrieves data from a software and paste it in and excel, the .py file only weights 2kb.

The problem is that when I use auto-py-to-exe, the resulting exe ends up weighting 308MB, which doesn´t make any sense for me. It works, but a file of that size is absolutely impractical to use and share. It seems as it all the python libraries are loaded into the exe. I tried asking Copilot but it didn´t give me any useful solution.

Do you have any idea on what could be happening and why to fix it so the resulting exe is a light one?

Edit: after using openpyxl instead of pandas, I managed to reduce the size from 300mb to 35 mb, which is impressive. I will keep trying other metods to squiz it even more. Thank you all for your help!


r/pythonhelp • • May 24 '26

How to send a python code so that the other person can execute it without python

4 Upvotes

Hi, I'm trying to send a code to my friend to rush them happy birthday and I need the code to run in their system without them having python. The problem I'm facing rn is that she can see whatever I've written on the code and I want that bit to be a surprise that she finds out once she executes the code. How do I do this?


r/pythonhelp • • Oct 01 '26

Advise needed on python

0 Upvotes

Is it good idea to learn python on YouTube if not what's the best way to learn python


r/pythonhelp • • Apr 29 '26

Can someone assist me with my code

0 Upvotes

I need to make a code that will ask me for the battery % (0-100) of a drone until i say stop
then i need to print

__ drones have less then 25% battery

then all drones with battery under 25% in a list type thing

AppropriateGarage332 is my 2nd account


r/pythonhelp • • Sep 30 '20

Anyone here to help me regarding python ?

1 Upvotes

r/pythonhelp • • Jan 03 '23

Modifying an object through another function

0 Upvotes

I'm looking at this LeetCode solution and there's something I don't understand about it. The dfs function doesn't return anything. How does the matrix stay updated outside the dfs function if it doesn't return the newly modified list?

Thanks ahead!


r/pythonhelp • • Jan 31 '18

Python Assignment Help

Post image
0 Upvotes

r/pythonhelp • • Nov 11 '22

How would I write python code for this

0 Upvotes

The 2010 US Census:

  1. Determine the size of the sheet (max_row and max_column)

  2. Count the total population in column (D)

  3. Count the number of census tracts in each state

Hint:

The following code may help in #3:

state_counter = {}

def addone(state):     if state in state_counter:           state_counter[state] += 1     else:           state_counter[state] = 1


r/pythonhelp • • Mar 18 '22

HOMEWORK Anyone know how I can solve this

0 Upvotes

Create a compound shape(2 or more shapes) that resizes based on a variable value

Ex.

Size =5 Size=10

this is in pygame


r/pythonhelp • • May 28 '23

Demystifying OOP in Python: Embracing Encapsulation, Inheritance, and Polymorphism

Thumbnail
self.coder_corner
0 Upvotes

r/pythonhelp • • Sep 06 '22

Function with multiple x

0 Upvotes

Hey I'm totally new to programming and I struggle with this task, so if anyone could help me out that would mean a lot.

Write a program that can calculate values of f (x) for the following function:

f(x)=x^-0.2, 0 < x <= 1, when x = (-0.4, 0.0, 0.4, 0.8, 1.2)

I tried this: but got the error "ZeroDivisionError: 0.0 cannot be raised to a negative power":

values=[-0.4, 0.0, 0.4, 0.8, 1.2]

for x in values:

y = x**(-2)

if(x > 0 and x < 1):

print(y)


r/pythonhelp • • May 28 '26

I NEEDI AM TRYING TO LEARN CS 50 INTRODUCTION TO PYTHON

0 Upvotes

i already have some prior experience in python as i have learn in high school ip (information practices) so i want to know would you still reccommened me to watch the lecture or should i do the practise problem and if i cannot do it then i watch the lecture

i learn the basic of function variable liberaries like matplotlib pandas lists etc


r/pythonhelp • • Jul 05 '26

Best resources to go from intermediate to advanced Python

Thumbnail reddit.com
0 Upvotes

r/pythonhelp • • Oct 31 '25

What projects to build after completion of python? I completed it. Any ideas?

Thumbnail reddit.com
0 Upvotes

r/pythonhelp • • Oct 22 '25

ROT13 Python Script

0 Upvotes

Hello,

I would like to be able to create a Python script that would encode a password with the ROT13 algorithm. For instance, if my password is "fishing", I would like to encode the password to svfuvat. Thanks in advance.

------------------------------

Edward Teach
Ethical Hacking and Penetration Testing Laboratory
ICTN 3910
[email protected]


r/pythonhelp • • 11d ago

Mr.Veeraragavan

0 Upvotes

I am loading few large size binary files (70 MB19 nos. look_up tables) in Main using more than 2/3 python files. On completion of the loading, I have to take up a series of search (in 3 or more threads) and arrive at the solution. I am using array.fromfile for loading which does not wait for loading completion. Hence, it fails saying array out of bounds. How do I delay the start of search, just till the loading is completed.


r/pythonhelp • • May 27 '26

Python Web Scraping & Automation Engineer Looking for Remote Work

2 Upvotes

Hi everyone,

I’m a Python Automation & Web Scraping Engineer with experience building large-scale scraping pipelines and automation systems for US-based clients.

Skills include:

• Selenium / Playwright

• APIs & data extraction

• Python automation

• ETL workflows

• Linux servers & cron jobs

• CSV/JSON/XLSX exports

Looking for remote freelance, contract, or long-term work related to web scraping, automation, or data engineering.

Feel free to DM me if you’re hiring or need help with a project.


r/pythonhelp • • Dec 06 '25

Python is versatile, but Asymptote is crazy for vector graphics! But i want to do all by python!

2 Upvotes

Hello guys! i am not developer at all. But i like doing coding and stuff. I had know python, C, and this vector graphic language. But i want to integrate python with asymptote bcz we all know python is so powerful. It has library like sympy, scipy, numpy, etc, which makes doing mathematic very easy.

my actual query is how can integration asymptote with python ? or is there python library what is best alternative to asymptote? i just want to do all my logic via python and remaining displaying par for asymptote

see how easy is Asymptote but can i have same result via python? u can run this code simply via https://asymptote.ualberta.ca/

size(400);
import markers;


// bezier control points
pair A=(0,0), C1=(0.6,0.8), C2=(1.0,1.6), B=(1.6,1.0);
pair D1=(1.8,0.6), D2=(2.3,0.2), C=(3.2,0.0);


// bezier paths
path p1 = A .. controls C1 and C2 .. B;
path p2 = B .. controls D1 and D2 .. C;


draw(p1, blue+1.2);
draw(p2, red+1.2);
dot(B, black);
label("$B$", B, dir(200), fontsize(10));


// tangents  arrow function with custom length
void drawTangentArrow(pair P, pair dir, pen col, real scale){
  draw(P--(P + scale * unit(dir)), col, Arrow(6));
}


// tangents at join
pair tan1 = 3*(B - C2);
pair tan2 = 3*(D1 - B);
drawTangentArrow(B, tan1, blue, 0.6);
drawTangentArrow(B, tan2, red, 1.0);
label("$\vec{T}_1$", B + 0.6 * unit(tan1) + (0.1, -0.01), blue);
label("$\vec{T}_2$", B + 1.0 * unit(tan2) + (0, -0.1), red);


// bezier derivative functions
pair bezierFirstDeriv(pair P0, pair P1, pair P2, pair P3, real t){
  return 3*(1-t)^2*(P1-P0) + 6*(1-t)*t*(P2-P1) + 3*t^2*(P3-P2);
}
pair bezierSecondDeriv(pair P0, pair P1, pair P2, pair P3, real t){
  return 6*(1-t)*(P2-2*P1+P0) + 6*t*(P3-2*P2+P1);
}
pair bezierPoint(pair P0, pair P1, pair P2, pair P3, real t){
  return (1-t)^3*P0 + 3*(1-t)^2*t*P1 + 3*(1-t)*t^2*P2 + t^3*P3;
}


// curvature circle with labeled center
void drawCurvatureCircle(pair P0, pair P1, pair P2, pair P3, real t, pen col, string labelName){
  pair r1=bezierFirstDeriv(P0,P1,P2,P3,t);
  pair r2=bezierSecondDeriv(P0,P1,P2,P3,t);
  real s=length(r1);
  real k=abs(r1.x*r2.y - r1.y*r2.x)/(s^3);
  if(k>1e-6){
    real R=1/k;
    pair normal=(-r1.y,r1.x)/s;
    pair P=bezierPoint(P0,P1,P2,P3,t);
    pair center=P+R*normal;
    draw(circle(center,R),col+0.8);
    dot(P,col);
    draw(center--P,dashed+col);
    dot(center, col);
    label("$" + labelName + "$", center, dir(90), fontsize(10)+col);
  }
}


//  curvature circles near join
drawCurvatureCircle(A, C1, C2, B, 0.98, blue, "C_1");
drawCurvatureCircle(B, D1, D2, C, 0.02, red, "C_2");

r/pythonhelp • • Nov 23 '25

Is PyCharm worth it?

3 Upvotes

Hey guys,

PyCharm is much loved in the coding community, I've basically been using VS code since the beginning.

Should I make the swap (to the community edition).

Context:
I'm not that experienced
I want to specialise in Python AI agents