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. Yeah, let’s see how much we messed it up. No, it still runs. Perfect.
00:14
And the other one was a hello_terminal.py
one in the hello/
folder. 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.
00:57 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. Okay.
Become a Member to join the conversation.