Misc
Case sensitivity
- Python is case sensitive.
Memory management
- Python performs limited garbage
collection (reference counting, rather
than mark and sweep).
- Memory only has to be managed explicitly
in
the
case of circular references and tracebacks.
Modules
- A module is a python file
- A package is a directory containing a
__init__.py file, and one or more modules or subpackages
Import a module in the current directory
import myfile
myfile.myvar # To use the variable, prefix it with the module name
from myfile import myvar
myvar # No need to prefix the variable
from myfile import *
myvar # No need to prefix the variable
Import a module in a package
import mypackage.myfile
mypackage.myfile.myvar # To use the variable, prefix it with the package and module name
from mypackage.custom import *
myvar # No need to prefix the variable
Misc
- Licensed under the Python Software
Foundation License (FSF-approved; GPL-compatible)
- Documentation Strings
- Pickle module
- Namespaces
- del
- Assignments do not copy data -- they just
bind names to objects. The
same is true for deletions: the statement "del x" removes the binding
of x from the namespace referenced by the local scope.