# Get the Full Path

* [https://www.programiz.com/python-programming/examples/current-working-directory](https://www.programiz.com/python-programming/examples/current-working-directory)

## Get the Full Path of the Current Working Directory

In this example, you will learn to get the full path of the current working directory.

To understand this example, you should have the knowledge of the following [Python programming](https://www.programiz.com/python-programming) topics:

* [Python File I/O](https://www.programiz.com/python-programming/file-operation)
* [Python Directory and Files Management](https://www.programiz.com/python-programming/directory)

### Example 1: Using pathlib module

```python
import pathlib

// path of the given file
print(pathlib.Path("my_file.txt").parent.absolute())

// current working directory
print(pathlib.Path().absolute())
```

**Output**

```
/Users/username
/Users/username
```

### Example 2: Using os module

```python
import os

// path of the given file
print(os.path.dirname(os.path.abspath("my_file.txt")))

// current working directory
print(os.path.abspath(os.getcwd()))
```

**Output**

```
/Users/username
/Users/username
```
