str1 = "/Users/krunal/Desktop/code/pyt/app.pyt"
import os
res = os.path.split(str1)
res1 = os.path.splitext(str1)
print(res)
print(res1)
"""
('/Users/krunal/Desktop/code/pyt', 'app.pyt')
('/Users/krunal/Desktop/code/pyt/app', '.pyt')
"""
str1 = "/Users/krunal/Desktop/code/pyt/app.pyt"
import os
res = os.path.split(str1)
res1 = os.path.splitext(str1)
print(res)
print(res1)
"""
('/Users/krunal/Desktop/code/pyt', 'app.pyt')
('/Users/krunal/Desktop/code/pyt/app', '.pyt')
"""