Created
July 11, 2017 05:35
-
-
Save lhsfcboy/16d167290f50eb783919bfdae901b582 to your computer and use it in GitHub Desktop.
read new license conf file and update to current using conf ini file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf8 | |
import configparser | |
import os | |
import requests | |
UL_DASHBOARD_LICENSE_PATH = r'C:\Users\mluo\Downloads\UL DASHBOARD_test_licenseTXT.txt' | |
UL_DASHBOARD_LICENSE_PATH_USING = r'C:\Ullink\platform201610Full\-CleanUp-\ULDASHBOARD\conf\ul-dashboard-server.ini' | |
cf = configparser.ConfigParser() | |
cf.read(UL_DASHBOARD_LICENSE_PATH_USING) | |
cf.remove_section("licence") | |
cf.read(UL_DASHBOARD_LICENSE_PATH) | |
secs = cf.sections() | |
print ('sections:', secs, type(secs)) | |
#cf.add_section("test") | |
#cf.set("test", "count", "1") | |
#cf.add_section("test1") | |
#cf.set("test1", "name", "aaa") | |
with open(UL_DASHBOARD_LICENSE_PATH_USING,"w+") as f: | |
cf.write(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment