Created
February 10, 2022 17:06
-
-
Save goish135/08d09c9f6a124d6f9c23aea8e07b5dbb to your computer and use it in GitHub Desktop.
app.config to paas import excel
This file contains 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
# V Read every line in application.config | |
# V split each line using equal operator | |
# --- | |
# write to excel: | |
# Put key value to excel specified field | |
# & default value already wriien in excel | |
# --- | |
# [Note] | |
# Check it ... | |
# Diff env diff value but same key | |
# File ref in para | |
# Erb context & mapping (file location) | |
# # dic name: dic | |
# dic = {} | |
with open('/Users/supinyu/Desktop/sample.config') as f: | |
for line in f: | |
print(line) | |
arr=line.rsplit("=") | |
print("key:"+arr[0]+"\t"+"val:"+arr[1]) # to be remove head tail space or not ? | |
dic[arr[0]] = arr[1].strip('\n') | |
print(dic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment