windows/ python-2.7/ path
i wanted to change the environment variable using python, but i need to load into the Windows Command Shell a variable which is stored in python.
I tried it like this :
userpath = 'C:/test_folder'
cmd = 'Path=%Path%; %s' % (userpath)
os.system(cmd)
But im am getting this error here : Traceback (most recent call last): File "J:\\Python_Script\\path_cahnge.py", line 7, in cmd = 'Path=%Path%; %s' % (userpath) ValueError: unsupported format character 'P' (0x50) at index 6
can someone help me with that ?
Thanks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.