How to give file path in python?
File handling is an important part of any web application. In file handling, the most important part is the path of a file.
We have a function by which we can get path of any file.
Here we’ll see that.
import os os.path.abspath("Name of the file") # absolute path
import os os.path.relpath("Name of the file") #relative path.
In this way we can get the path of file in python.
Please login to comment
View all comments