Updating File Contents - Windows Terminal
00:00
Since the file is now called hello_world
, let’s change the content as well, into print('Hello, World!')
. Okay, so this is pretty much the same as before, where we just echo
the command that we want and then redirect (>
) it into hello_world
.
00:23
I use tab auto-complete again there to just put less typing, and this will actually overwrite everything in that file. So if I press Enter now and cat hello_world.py
, you’ll see that the content is now slightly different according to what we echoed into it.
00:42
So you can actually also run it as a Python file, and it should print Hello,
World!
. That is correct. Well, that is the hope at least. There we go.
00:51
Yes. Wonderful. So the last thing I want you to do is to also run the hello_terminal
file that’s in our hello
subfolder. Okay, well, I could do this in two ways.
01:03
I could either cd
into that folder and then run it from there, or I could just run it from here directly. So since we haven’t done that before, we can do that.
01:12 I’m just going to put in the full relative path now,
01:17
and I use tab auto-complete again for both parts: to auto-complete the hello\
folder and then auto-complete the file in that folder. And now I can just run this …
Become a Member to join the conversation.