(Home)

Getting started

Starting the python interpreter

python3 --version

Python 3.9.1

python3

python terminal

Python Scripts

emacs hello_world.py

emacs hello world

python3 hello_world.py

hello world terminal

emacs hello world

then you get no output when you execute it:

emacs hello world

python3 hello_world.py > hello_world.log

emacs hello world

emacs hello world

python3 -i hello_world.py

emacs hello world

python3 -h

Executable Scripts - Linux

#!/usr/bin/env python3

emacs hello world

chmod +x hello_world.py

./hello_world.py

emacs hello world

Executable Scripts - Windows

Integrated Development Environments (IDEs)

Modules & packages

For more complicated projects, you should divide your code into modules (possibly arranged in a package) so that it's well structured and easy to maintain and reuse. See the course material info on modules and packages.