extract file path python code example
Example 1: python get filename from path
import os
print(os.path.basename(your_path))
Example 2: path to create a text file in python
outFileName="F:\\folder\\folder\\filename.txt"
outFile=open(outFileName, "w")
outFile.write("""Hello my name is ABCD""")
outFile.close()