

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get full path of current file's directory in Python?
To know the complete path to current file use the os module.
For example
>>> import os >>> print(os.path.realpath(__file__)) /home/ayush/qna/path.py
- Related Questions & Answers
- How to print full path of current file's directory in Python?
- How to extract a part of the file path (a directory) in Python?
- Get the absolute path for the directory or file in Java
- How do you get the current figure number in Python's Matplotlib?
- How can I get a file's permission mask using Python?
- Get Root Directory Path of a PHP project?
- Java Program to get the File object with the absolute path for the directory or file
- How can I get a file's size in C++?
- How to get the current open file line in Python?
- How to change current directory using Python?
- Java Program to Get Current Working Directory
- How to get the Tkinter widget's current x and y coordinates?
- How to find current directory of program execution in Python?
- How to know current working directory in Python?
- How to get computer's UTC offset in Python?
Advertisements