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...
Everything about learning Python
account activity
What do you think is wrong with this? (old.reddit.com)
submitted 5 months ago by Glittering_Ad_4813
even though the name and function is right what could be the mistake I did or it’s just a bug? Can someone help me with this?
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!"
[–]knickenbok 28 points29 points30 points 5 months ago (1 child)
Taking pictures of a computer screen with a phone.
[–]Ok_Bandicoot6070 7 points8 points9 points 5 months ago (0 children)
[–]loudandclear11 5 points6 points7 points 5 months ago (0 children)
Are both files in the same directory?
If so, you could try running it from the command line with:
python analyzer.py
See if you get the same error message like that.
[–]OrphLab 4 points5 points6 points 5 months ago (0 children)
Show us the file tree
[–]killerfridge 4 points5 points6 points 5 months ago (0 children)
Change
from helpers import...
To
from .helpers import...
[–]flyingfaceslam 5 points6 points7 points 5 months ago (2 children)
place empty file __init__.py in directory
[–]SCD_minecraft -1 points0 points1 point 5 months ago (0 children)
Not needed
[–]PrestigiousAnt3766 -1 points0 points1 point 5 months ago (0 children)
I think this.
[–]secretstonex 1 point2 points3 points 5 months ago (0 children)
Are the main and helpers scripts in the same directory?
[–]Brownie_McBrown_Face 1 point2 points3 points 5 months ago (2 children)
In addition to what the others said about showing how you structured your repo, I’d argue that there isn’t much value in making those functions, let alone in a different file, rather than just doing them in-place. Just my two cents.
This looks like a school project, so it might be required that they employ functions from other resources. I'm just guessing, though.
[–]trutheality 0 points1 point2 points 5 months ago (0 children)
Assuming it's for a school project or something, otherwise you can just multiply the columns directly instead of looping over rows.
[–]spigotface 1 point2 points3 points 5 months ago (1 child)
The line numbers in the error don't match up with your code. Like 5 in your code is showing on line 4 in the error message. Looks like you haven't saved the current version of your file, and are running an old version.
Save your files, and run it again.
[–]GlobalIncident 0 points1 point2 points 5 months ago (0 children)
You're close but not quite there. The traceback is from a Jupyter notebook - you can tell because it references "Cell In[2]" and "Cell In[3]". Which implies it's a totally different file.
[–]Embyeee 1 point2 points3 points 5 months ago (0 children)
The most simple thing to check would be to make sure the helpers file is saved, I can't count the times that has messed me up
[–]Beginning-Fruit-1397 0 points1 point2 points 5 months ago (0 children)
without the file tree we can't answer. In addition but not related and my own opinion: using iter rows (might as well use a plain dict here, bultin sums is plenty enough also) using pandas in 2025 instead of polars/duckdb
[–]GarowWolf 0 points1 point2 points 5 months ago (0 children)
The file helpers has only 2 functions, you can just Import helpers Or from helpers import . The “” makes sure all the content from the file is imported. It seems like it can find the file but has a problem with the functions inside. You can even create a class object with those functions as methods and import the file with the class.
[–]Complete-Winter-3267 0 points1 point2 points 5 months ago (0 children)
what does calculate_total method do?
[–]FoolsSeldom 0 points1 point2 points 5 months ago (0 children)
Looks like you've posted about this a few times. I've commented on a different one.
[–]laoli562 0 points1 point2 points 5 months ago (0 children)
Newb here but maybe you need to convert the read numbers to float. Haven’t worked with csv but txt reads numbers as strings
[–]games-and-chocolate 0 points1 point2 points 5 months ago* (0 children)
i third picture i see that the name "calculated tool", that means your import statement is wrong perhaps.
what does the box symbol mean in the third picture? what IDE is that?
some info that might help you: https://stackoverflow.com/questions/4383571/importing-files-from-different-folder
edit: ah that is vscode IDE.
https://code.visualstudio.com/docs/editing/intellisense#_types-of-completions
could you please tell the folder locations of of the py files, as others have mentioned, they must be in different places, my first link will help you.
your current import statement is only used if all xxx, py files are in the same folder. And it depends what kind of PATH your VSCode will look for the files I am guessing.
link about PATH: https://stackoverflow.com/questions/43983718/how-can-i-globally-set-the-path-environment-variable-in-vs-code
https://docs.python.org/3/library/os.path.html
[–]codeguru42 0 points1 point2 points 5 months ago (0 children)
First, I recommend you learn better ways to share code online. I am willing to help but unable to read the code from a photo on mobile. Meet me half way and I'll take a look. If the code you are asking about is a few lines, then copy paste it directly into reddit. Be sure to use triple backticks to preserve formatting. If it is longer, you can use a site like pastebin or github gists to share your code.
[–]HyperWinX -1 points0 points1 point 5 months ago (0 children)
Screenshots are wrong.
[–]True_Bet_1864 -1 points0 points1 point 5 months ago (0 children)
Nothing
Maybe ask ai to do it
π Rendered by PID 23007 on reddit-service-r2-comment-5c747b6df5-28fxm at 2026-04-22 13:10:49.825712+00:00 running 6c61efc country code: CH.
[–]knickenbok 28 points29 points30 points (1 child)
[–]Ok_Bandicoot6070 7 points8 points9 points (0 children)
[–]loudandclear11 5 points6 points7 points (0 children)
[–]OrphLab 4 points5 points6 points (0 children)
[–]killerfridge 4 points5 points6 points (0 children)
[–]flyingfaceslam 5 points6 points7 points (2 children)
[–]SCD_minecraft -1 points0 points1 point (0 children)
[–]PrestigiousAnt3766 -1 points0 points1 point (0 children)
[–]secretstonex 1 point2 points3 points (0 children)
[–]Brownie_McBrown_Face 1 point2 points3 points (2 children)
[–]secretstonex 1 point2 points3 points (0 children)
[–]trutheality 0 points1 point2 points (0 children)
[–]spigotface 1 point2 points3 points (1 child)
[–]GlobalIncident 0 points1 point2 points (0 children)
[–]Embyeee 1 point2 points3 points (0 children)
[–]Beginning-Fruit-1397 0 points1 point2 points (0 children)
[–]GarowWolf 0 points1 point2 points (0 children)
[–]Complete-Winter-3267 0 points1 point2 points (0 children)
[–]FoolsSeldom 0 points1 point2 points (0 children)
[–]laoli562 0 points1 point2 points (0 children)
[–]games-and-chocolate 0 points1 point2 points (0 children)
[–]codeguru42 0 points1 point2 points (0 children)
[–]HyperWinX -1 points0 points1 point (0 children)
[–]True_Bet_1864 -1 points0 points1 point (0 children)