How to know current working directory in Python?



To know the current working directory or pwd use the os module.

For example

>>> import os
>>> print(os.getcwd())
/home/ayush/qna
Updated on: 2019-12-12T07:30:38+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements