Python¶
This is the introduction to Python notes, the notes are divided in:
- Basics.
- Intermediate.
- Libraries and Modules.
- Frameworks.
- Projects.
- Scripts & algorithms.
- Virtual environments.
Some useful information¶
How to know the import path¶
How to know the current directory¶
How to inspect a module¶
To inspect a module we can use dir(name_module)
and it will output all information about the module
About Python Packages¶
- Function: Container of
variables
andexpressions
- Class: Container of
variables
andfunctions
- Module: (roughly) represent a python script which contain class, function, variables, and expressions
- Packages: Solution to manage python modules. Contain multiple modules and the file init.py
some more information here Making a Python Package
Some Good Rules¶
- Be explicit
- Import Only what you needed
- Give the right names to packages imports and variables