Why do I study Python
Each program has advantage itself, why I study python program? This book(*1)
give us several advantages :
maintainable.
4. Module : many module is written in python
User
Many companys adopt Python language to develop its products. such as :google,
youtube, dropbox, google app engine...etc
What do python do
1. GUI
2. OS program
3. Internet program
4. Component Integration
5, Database program
Python feature
1. Dynamic typing : you don't need to declare a type or variable size in advance.
Such as: i = 0 ;
2. Automatic memory management : it when the object is created
it can automatic create and destroy
object. python
3. third-party utilities : developers contribute many packages that is write in
Python. To use these save your development time.
4. easy to use : like human syntax and simple read or write.
5. free : It is free.
Download python
Download python install : https://www.python.org/downloads/
Python 2.X : it is a legacy.
Python 3.X : it is a evolution software and new features. such as: Unicode support.
which version should I use : ref https://wiki.python.org/moin/Python2orPython3
install
When the python code(.py) is executed first time, it will be into bytecode(.pyc).
Bytecode is an implementation detail of the CPython interprete and low-level code.
Bytecode makes execute faster than original source .
Python code is compiled to byte code(.pyc), PVM will execute the byte code.
PVM is a engin of Python.
- Setting variable environment
Edit Path : C:\Python27\; C:\Python27\Scripts
> python
> ctrl + Z
If you had installed many python versions, you can py -2 or py -3 to switch
different python version.
1. Select IDLE , open Python Shell window
3. To write python's script
open New File.
write a program
Run Module or F5
The script has executed and right to get answer
Note:
*1. Learning Python, 5th Edition, O'Reilly Media, ISBN:978-1-44935-573-9
留言
張貼留言