os.path.isdir code example
Example 1: python os.path.isdir exception
import os
if os.path.isdir(root_folder):
print('Ok')
else:
print('Nok')
Example 2: python get base directory
import os
os.path.dirname(os.path.realpath(__file__))
import os
if os.path.isdir(root_folder):
print('Ok')
else:
print('Nok')
import os
os.path.dirname(os.path.realpath(__file__))