Use your text editor to create a file called
Copy the following lines.
When you are satisfied the file is correct, save it. Then in your
terminal window, set "execute" permission for the file with the
chmod +x hello.py
(Be careful to put a space before and after the
+x.) Then run
your script with the command
You should see the message, "Hello, world!" printed on your screen.
You can also run your Python script from the command line by typing
python3 hello.py. If you want to do it this way, you
don't need to put the
#! /usr/local/bin/python3 line at the top
of your file and you don't need to do the
When you are finished, exit the editor.