4. Get the current path of the folder, the file name and path of the current os.path.realpath

Use os.path.realpath (__ file__) to obtain the path name of the current folder, use the path os.path.split be cut

import os

src, _= os.path.split(os.path.realpath(__file__))
print(src, _)

Algorithms effect

Guess you like

Origin www.cnblogs.com/my-love-is-python/p/11018524.html