'How to print out the current working directory of gdal package in python?

I have searched around and have not seen a way to print out the current working directory for the gdal package in Python at all in Stackoverflow. Is there a method that I am missing? I did not see any method related to current working directory for gdal's python package at https://gdal.org/api/python.html

I was trying to call the gdal.warp(xxx, xxx), but it shows input file type is invalid.

Thanks ahead.



Solution 1:[1]

A process has only one current working directory at a time. So you can just use

import os

print(os.getcwd())

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vaizki