Reputation: 83
I want to be able to transfer a variable set in python to be used in a batch file. Is this possible?
Upvotes: 0
Views: 767
Reputation: 91029
Set environment variable in your python script, and use that variable in your batch file
>>> import os
>>> os.environ['x'] = 'a'
>>> os.system('echo %x%')
# prints 'a'
Upvotes: 1