I would like to set environment parameters using python in windows 11. Using commands like:
import os
os.environ['USER'] = 'username'
print(os.environ['USER'])
will print username. Nether the less, once I close the window. The set environment parameters dissipated. It seems I need something like SETX command in windows. I found the article how do I make environment variable changes stick in python. Nether the less, they use there the windows command.
Are there python commands as well to do the same? instead of sending subprocess or os.system commands.