import os print(os.path.basename(your_path))
Here is what the above code is Doing:
1. Importing the os module.
2. Using the os.path.basename() function to get the filename from the path.
3. Printing the filename.
import os print(os.path.basename(your_path))
Here is what the above code is Doing:
1. Importing the os module.
2. Using the os.path.basename() function to get the filename from the path.
3. Printing the filename.