File tree 1 file changed +7
-10
lines changed
Scripts/Miscellaneous/json2yaml
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,12 @@ def getJSONValueFromFile(jsonPath):
25
25
with open (jsonPath , "r" ) as jsonFile :
26
26
return load (jsonFile )
27
27
28
- jsonValue = getJSONValueFromFile (jsonPath )
29
-
30
- # from line 36 to 38
28
+ if __name__ == "__main__" :
31
29
# I opened (and created if not done) the yaml destination file
32
30
# after that I dumped the dict into the yamlFile through pyyaml
33
- # after that I closed the csv file
34
-
35
- yamlFile = open (yamlPath , "w" )
36
- dump (jsonValue , yamlFile )
37
- yamlFile .close ()
38
-
39
- print (f"done, your file is now on { yamlPath } " )
31
+ # after that I closed the csv file
32
+ jsonValue = getJSONValueFromFile (jsonPath )
33
+ yamlFile = open (yamlPath , "w" )
34
+ dump (jsonValue , yamlFile )
35
+ yamlFile .close ()
36
+ print (f"done, your file is now on { yamlPath } " )
You can’t perform that action at this time.
0 commit comments