Answers for "python os path basename"

1

python get base directory

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

os path splitext

import os
basename, ext = os.path.splitext('inputfile.txt')
Posted by: Guest on November-24-2020

Python Answers by Framework

Browse Popular Code Answers by Language