Answers for "how to get current path eqaually in all os python"

11

python get current file location

import os
os.path.dirname(os.path.abspath(__file__))
Posted by: Guest on May-11-2020
-1

what does filename = path(file).stem python

from pathlib import Path

Path('/root/dir/sub/file.ext').stem

# returns 'file'
Posted by: Guest on June-03-2020

Code answers related to "how to get current path eqaually in all os python"

Python Answers by Framework

Browse Popular Code Answers by Language