What is Python?
- A scripting language ( source code ->intepreter) : source code --> compiler --> byte code -> intepreter
- python virtual machine
- no need for def main(), but you can run by if ___name\__ = 'main":
- dynamic reference( type can change at run time), strongly-typed language
- almost everything in python is an object(id, name), bind with names
- dir()-display names in the current local scope
- """... """ can produce automatic model documents
- library
-
- functional programing
- object oriented
- multi-purpose
- web: WSGI API, Django framework, Flask, cache, unit test,
- GUI: wxPython, PyQt
- OS: linux, mac, NetBSD
- game: 3D model
- Data sicence: integrating with C, C++ and FORTRAN
- prototyping + production
- Weakness
- single thread
- global interpreter lock(GIL) determines interpreter can only execute one line at the same time
- Python C extensions can use native multithreading (in C or C++) can run code parrallel without being impacted by GIL