Reputation: 13141
How would I go about getting the Windows/System folder paths in python? I need to be able to read from an INI that gets written to the Windows directory.
Upvotes: 3
Views: 8148
Reputation: 12613
Use the environment variable %WINDIR%
.
import os
winpath = os.environ['WINDIR'] + "\\System\\"
inifile = open(winpath + filename)
Upvotes: 9