python small note (3) Operation File

Action File

shutil.move (): Copy the file can be achieved, mobile

os.walk (): used to walk through the directory tree output file name in the directory, up or down
A list of files or file os.listdir () method returns the specified folder contains a folder name
 
Get the current path:
import os
print(os.path.abspath('.'))
Get the current module file name: print (__ file__)

Guess you like

Origin www.cnblogs.com/ruguokeyi/p/11119851.html