set python in environment variable code example Example: python set windows environment variable os.environ['API_PASSWORD'] = 'secret'