Jun-18-2021, 08:53 PM
Greetings!
You guys pointed me to this module - 'import Path' and I'm trying to understand how to use it.
Seached Google, found now simple examples, all the same jibberish about 'home" directory and 'Path.cwd()'
I'm sure there are a lot of people looking for a simple explanation on how to use it.
For example:
I tried to make changes to the snipped but it errors out.
Thank you in advance!
You guys pointed me to this module - 'import Path' and I'm trying to understand how to use it.
Seached Google, found now simple examples, all the same jibberish about 'home" directory and 'Path.cwd()'
I'm sure there are a lot of people looking for a simple explanation on how to use it.
For example:
from pathlib import Path home = Path.home() wave_absolute = Path(home, "ocean", "wave.txt") print(f" Home Dir ------------- {home}" ) print(f" Absolute path\\file -- {wave_absolute}")What if a directory is not 'home' but 'c:\\02'
I tried to make changes to the snipped but it errors out.
src = 'c:\\02' home = Path.src()Or
home = Path('c:\\02')I'm sure the module is a great tool but documents are horrible and examples are awful...
Thank you in advance!