>>> Names = ["jack", 24, 'Rose ', 22, ['name', 'age'] # define a list
>>> Isinstance (names, list) # determine if names belongs to the list type
True
# Exit the interpreter with quit () in Python
Alt + P # previous Code
Alt + N # Next code
Dir (_ builtins _) # built-in functions, built-in Function
# If you forget a bif tab, many tips will be given.
>>> Import OS # import standard library OS
>>> OS. getcwd () # obtain the current working directory
'C: \ python33'
>>> OS. chdir ("D: \ code \") # Switch the Directory
>>> Data‑open('1.txt ') ← open the 1.txt File
>>> Print (data. readline (), end = '') # Read a row in the file using the readline () method
And then print it on the screen.
Life Is Short, Use Python!
>>> Print (data. readlin, end = '') # Read a row in the file using the readline () method
And then print it to www.2cto.com on the screen.
The osc is about to become another cnbeta!
>>> Data. seek (0) # Use the seek () method to return to the start position of the file
0
>>> For each_line in data:
Print (each_line, end = '')
# Output file content by falling
The osc is about to become another cnbeta!
Life is short-you need Python!
Because of the new work, I have been studying the python language for several consecutive days.
I also read many articles about python in China and abroad.
As I have learned more about python over the past few days, I feel that learning python is really "too pressing ".
".
>>> Data. close () # close the file
>>>