Join us and get access to thousands of tutorials and a community of expert Pythonistas.
This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.
Revisiting Python Files
00:00
We are almost at the end, so the last thing I want you to do is to run the two files—one’s the hello_world one—to see that it’s actually still working.
00:10
Yeah, let’s see how much we messed it up. No, it still runs. Perfect. And the other one was a hello_terminal.py one in the hello/ folder.
00:19
Right. And then what we want to do there is to first spell out the folder name, and then we do the / to say that now we’re inside of that folder, and then I can do hello_terminal.py, and we see that this runs.
00:34
Wonderful. Okay. So that means, like, with the python command, you not only have the Python file that’s in the same folder that you can run, but you can give it a path to a file, and then you can run it from there.
00:48 Exactly. Or to be more precise, you’re still running it in your current working directory, but you are running a file that is somewhere else, right? Yeah. There’s some details to how the Python path works that could be slightly confusing, but in general, yeah, you can run scripts from anywhere by giving the full paths.
Become a Member to join the conversation.