Skip to main content

Mojo function

cwd

cwd() -> Path

Gets the current directory.

Examples:

from pathlib import cwd

try:
    var string_path = cwd()
    print(string_path)
except e:
    print(e)

Returns:

Path: The current directory.

Raises:

If the operation fails.

Was this page helpful?