python automation notes on the first day

1, while circulation loop for loop

2, for i in range (1,12,2): #range rear brackets represents an element from the beginning, all the elements 10 represents 0-9, when the representative value of 2 plus 2

3, break stop

4, if elif else statements Analyzing 

5, import python libraries loaded, the system comes there sys os,

SYS Import 
Print (the sys.argv)
Print (the sys.argv [2])
Import and interactive system os #
cmd_result = os.system ( "dir") # execute commands only, without saving the results
cmd1_result = os.popen ( "dir ") .read () # o read current path
Print (cmd1_result)
os.mkdir (" NewFolder ") plus a new file #
6, encode decode python3 comes encoding format is UTF8

Guess you like

Origin www.cnblogs.com/chenxiangxiang/p/11617350.html