How to give file path in python?
![](https://pythonpoint.net/wp-content/uploads/2020/12/Green-and-Purple-Dynamic-Frames-Action-_-Adventure-YouTube-Channel-Art-4-1024x576.jpg)
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.
syntax:-
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.
Subscribe
Login
Please login to comment
0 Discussion