12
I spent nearly four hours yesterday trying to get a simple Python script to read a file. The path was wrong the whole time.
4 comments
Log in to join the discussion
Log In4 Comments
logan_gonzalez1mo ago
Been there. Path issues are the worst kind of time sink.
6
max_cooper218d ago
Hear me out though - the real kicker is that Python's path handling is actually pretty smart, it just hides the working directory stuff from you until it breaks. Every time I think I've got it figured out, I run the script from the wrong folder and waste 20 minutes staring at the same error lol. Double check your current working directory with os.getcwd() before you go changing paths.
3
noahgreen1mo ago
Path issues are the worst" is right. I once spent a whole afternoon because my script was looking in the downloads folder but the file was on the desktop. Felt like an idiot when I finally saw it.
2
the_sean1mo ago
Absolute path saved me after a similar mess. Logan_gonzalez is right about the time sink, it's crazy how much gets wasted. Now I double check the working directory before running anything. That desktop versus downloads mix up happens way too often.
7