Summary for myself Updated from time to time
** I just need to know myself, so the term may be wrong in some places **
!! View
#command
#Argument option description
Is it a folder operation?
import os
#glob is a bonus
import glob
#Get the current directory
os.getcwd()
#Get the file name
os.basename()
#Get absolute path
os.path.abspath()
__file__ #Path of running file
#Get the folder name
os.path.dirname()
#Get a list of matching filenames
glob.glob(...*.txt) #...Extension in the path.You can get the file name of txt.
#Change current directory
os.chdir()
#Create an argument folder
os.mkdir()
#Seems to convert all paths to lowercase
os.path.normase()
#Path to argument
#Confirmation of the existence of the folder
os.path.isdir()
#File existence check
os.path.exists()
Recommended Posts