1.read,readline和readlines 2.write和writeline

read read the entire file

readline reads the next line

readlines read the entire file into an iterator (list) for us to traverse

 

txt file:

Therefore, we train, the commonly used iterator can be set up: After generating the list by readline, check it on the shuttle list

 

Training, can also be a list of write-once data txt file: writeline

 

 

 

Guess you like

Origin blog.csdn.net/weixin_38740463/article/details/90786200