Python os.getcwdb() Method
Example
Print the current working directory in bytestring:
#Import os and stat Library
import os,stat
#print the current working directory in bytestring
print(os.getcwdb())
Try it Yourself »
Definition and Usage
The os.getcwdb()
method returns the current working directory in bytestring.
This method returns the path from the system's root directory.
This method is bytes version of
os.getcwd()
method.
Note: This method is available on UNIX and WINDOWS platforms.
Syntax
os.getcwdb()
Technical Details
Return Value: | A bytes value, representing the current working directory
|
---|---|
Python Version: | 3.0 |
Change Log: | 3.8 - The function now uses the UTF-8 encoding on Windows |