os.path.expanduser code example
Example 1: python os.path.isdir exception
import os
if os.path.isdir(root_folder):
print('Ok')
else:
print('Nok')
Example 2: os path splitext
import os
basename, ext = os.path.splitext('inputfile.txt')
import os
if os.path.isdir(root_folder):
print('Ok')
else:
print('Nok')
import os
basename, ext = os.path.splitext('inputfile.txt')