Python - Getting Started: Basic Tools
Note: Read the offical docs to get the most updated information.
Getting Started: Basic Tools
Install
Follow the instructions in python Beginners Guide. On most Linux distributions Python comes pre-installed.
## example for debian based distros
$ sudo apt install python3
$ python --version
-
python-dev
is the package that contains the header files for the Python C API, which is used by lxml. You need to install, if you are going to compile python extension modules.
Hello World
Python files always end with the .py
extension.
If you’re using more than one word in your filename, the convention is to use snake case
.
print('Hello, world!')
Notes about the code:
- There’s no need for a
main
funtion, unlike in C. - The
print
directive simply prints out a line, unlike in C. - There’s no need for to end the line with a semicolon
;
to indicates that thee expression is over, unlike in C.
Compile and run
You won’t notice a compiler because it runs automatically
$ python hello.py
Hello, world!
Leave a Comment