Skip to content

Instantly share code, notes, and snippets.

@knu2xs
Created December 16, 2019 14:39
Show Gist options
  • Save knu2xs/8b18f5cfb691eaccae4ad83d99d76f28 to your computer and use it in GitHub Desktop.
Save knu2xs/8b18f5cfb691eaccae4ad83d99d76f28 to your computer and use it in GitHub Desktop.
Python Set User Environment Variable in Windows
import os
key = 'SOME_KEY'
val = 'someValue'
os.system(f'setx {key} {val}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment