README First.
-
Note: If you sort this category by Oldest to Newest you will get the articles in learning order.
Unless otherwise stated all the articles use a file called
script.py,
thepy
at the end being the extension for Python scripts.Some of the articles use the old python2 print statement, use the python3 print function instead. For example
print('This is the new print function')
If you are using a linux desktop or server, python is normally integrated into the operating system.
Typing python will verify this.
$ python3 Python 3.8.5 (default, Oct 8 2020, 13:36:54) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
Type Ctrl-D to exit.
or you can simply run this.
$ python --version Python 3.8.5 $ python3 --version Python 3.8.5
To run a python script. Either put #!/usr/bin/python at the top of the file, the very first line, this tells the script where to find the python command.
Run it like this, the "./" mean run it from your current directory, where the python script it located.
$ ./script.py
or run:
$ python script.py
© Lightnetics 2024