The os.getcwd() Method

The os.getcwd() method returns a string representing the current working directory.

import os

print("Current working directory:", os.getcwd())

Output:

Current working directory: /home/ubuntu/workspace

results matching ""

    No results matching ""