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
Thibaut Lamadon edited this page Jun 8, 2022
·
2 revisions
Just a few notes on using pathlib. You can pass pathlib objects to input and output fields of Tasks.
frompathlibimportPath# define a pathpath=Path('mynewfolder')
# make sure the path existspath.mkdir(parents=True, exist_ok=True)
# refer to a file on that pathmy_file=path/Path('somefile.txt')
# check if file existsmy_file.exists()
# get a list of files with globlist(path.glob('*.txt'))
# replace filename or file extensionpath.with_name('bye')
path.with_suffix('.tex')