python read relative path


1. Read at the same level

If a .py file
is at the same level as the folder m , path='./folder m name/'
path =' ./m/' when reading

2. Non-same level (upper level)

If a .py file
is at the same level as the parent folder n of folder m , path='./n/folder m name/'
path =' ./n/m/ '

Guess you like

Origin blog.csdn.net/qq_41081593/article/details/112213478