python learning the first day notes

1, open the windows command line

  1.1 win+R

  1.2 input cmd, enter into the windows command line

2, windows common command line operation

  2.1 shows the file directory, dir

  2.2 back to the parent directory, cd ..

  2.3 back to the root directory, cd \

  2.4 change directory, cd folder \ folder \

3, windows command line prompt to enter and exit the interactive python

  3.1 Input python, press Enter to open an interactive python prompt in windows command prompt

  3.2 Press assembly ctrl + z, exit the interactive prompt python

4, python Run

  4.1 interactive prompt. Typically a small amount of code for running

  4.2 scripted. When you run a lot of code

5, python program execution

  5.1python (* py.) - bytecode (* .pyc), by an interpreter realized

  5.2 bytecode (* .pyc) - machine code, realized by PVM

6, static and dynamic languages

  Static languages ​​such as c #, java, etc., is determined by the variable types, variable types can not change

  Dynamic languages, such as Python, determined by the object type, variable type may vary

7, python variable types and memory address lookup

  7.1 Variable types of queries, type ()

  7.2 Variable memory address lookup, id ()

8, python variables Naming Considerations

  8.1 Variable numbers, letters and underscores

  8.2 Variable names can only begin with a letter or underscore

  8.3 avoid python keywords, functions of the same name

  8.4 and with a brief descriptive naming

  And a distinction 8.5 l, 0, and o

9, python in garbage collection and counter

  When an object is assigned to a variable, the counter is incremented automatically when the variable assignment changes, the object counter by 1, when the counter reaches zero, the garbage collection mechanism is automatically released unreferenced objects.

Guess you like

Origin www.cnblogs.com/zhuome/p/11291708.html