You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# in m1.pyf=FileFinder() # means directory `~/root/module1`f=f.child('sub_dir1') # means directory `~/root/module1/sub_dir1`f.file('source.0.ext') # return `~/root/module1/sub_dir1/source.0.ext`# so , we can get the `source.0.ext` path in one statement:FileFinder().child('sub_dir1').file('source.0.ext')
# in m2.py# to get source.0.ext's pathFileFinder().parent.child('module1').child('sub_dir1').file('source.0.ext')
now we can always get file path relative to my current file path :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters