gsplot.path.path#

Functions

home()

Returns the path to the user's home directory.

pwd()

Returns the current working directory.

pwd_main()

Retrieves the directory of the executed main file or the current working directory.

pwd_move()

Changes the current working directory to the value of pwd().

home()[source]#

Returns the path to the user’s home directory.

This is a convenience function wrapping Path.get_home.

Returns:

The absolute path to the home directory.

Return type:

str

Examples

>>> import gsplot as gs
>>> home_dir = gs.home()
>>> print(home_dir)
"/home/user"  # Example output
pwd()[source]#

Returns the current working directory.

This is a convenience function wrapping Path.get_pwd.

Returns:

The absolute path of the current working directory.

Return type:

str

Examples

>>> import gsplot as gs
>>> current_dir = gs.pwd()
>>> print(current_dir)
"/home/user/project"  # Example output
pwd_main()[source]#

Retrieves the directory of the executed main file or the current working directory.

This function is a convenience wrapper around PathToMain.get_executed_file_dir.

Returns:

The directory of the executed main file or the current working directory.

Return type:

str

Examples

>>> import gsplot as gs
>>> executed_dir = gs.pwd_main()
>>> print(executed_dir)
"/home/user/project"  # Example output for an executed script
pwd_move()[source]#

Changes the current working directory to the value of pwd().

This is a convenience function wrapping Path.move_to_pwd.

Examples

>>> import gsplot as gs
>>> gs.pwd_move()  # Changes directory to the current working directory