how to get current path eqaully in all os python code example
Example 1: python get current file location
import os
os.path.dirname(os.path.abspath(__file__))
Example 2: what does filename = path(file).stem python
from pathlib import Path
Path('/root/dir/sub/file.ext').stem
# returns 'file'