Python os.getcwdu()方法 返回一个表示当前工作目录的 unicode 对象。
随着 Python 3.0 版本的发布,os.getcwdu() 方法已被弃用。我们可以使用 os.getcwd() 方法来代替此方法。
语法
Python os.getcwdu() 方法的语法如下 -
参数
Python os.getcwdu() 方法不接受任何参数。
返回值
Python os.getcwdu() 方法返回表示当前工作目录的 unicode 对象。
例以下示例显示了 getcwdu() 方法的用法。
当我们运行上述程序时,它会产生以下结果——
Current working dir : /var/www/html
Current working dir : /tmp
Current working dir : /tmp