python windows path string code example
Example 1: file path in python for windows
outputFileName = 'Destination/With/Forward/Slash/filename.txt'
Example 2: python path from string
from pathlib import Path
str_path = "my_path"
path = Path(str_path)
Example 3: what does filename = path(file).stem python
from pathlib import Path
Path('/root/dir/sub/file.ext').stem
# returns 'file'