python os path folder code example
Example 1: python get base directory
import os
os.path.dirname(os.path.realpath(__file__))
Example 2: os path splitext
import os
basename, ext = os.path.splitext('inputfile.txt')
import os
os.path.dirname(os.path.realpath(__file__))
import os
basename, ext = os.path.splitext('inputfile.txt')