os.getenvb() method is a bytes version of os.getenv() method. This function of os module also returns the value of the environment variable correlated with specified key. But contrasting os.getenv() method, it accepts a bytes object as the key and returns a bytes object as the value of the environment variable.
Syntax:
os.getenvb(key, default = None)
Parameters:
key: It is a bytes object which is denoting the name of environment variable.
default (optional) : It is a string denoting the default value in case if key does not exists. It's default value is "None".
Return Type:
This function returns a bytes object which signify the value of the environment variable. In case if key does not exists it returns the value of default parameter.
Example:-
Syntax:
os.get_exec_path(env = None)
Parameter:
env(optional): A dictionary representing the environment variables. The default value of this parameter is None.
Use of os.get_exec_path() method:-
Comments