r/learnpython • u/pedrinjose • 10d ago
Basically, if main
In Python, when you run your program in another folder, we add this, but I don't understand why. What's the point of doing this? If someone could explain it in a simplified way, I'd appreciate it.
10
Upvotes
View all comments
1
u/codeguru42 9d ago
To emphasize a key point it is about how the file is loaded by the interpreter not about the folder where the file is located.