Skip to content

Commit cc4c546

Browse files
author
David Mendoza
committed
commented the validated argv
1 parent 6b8bb1f commit cc4c546

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Scripts/Miscellaneous/xml2csv/xml2csv.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
xmlPath = ""
77
csvPath = ""
88

9+
# validated the ammout of args passed from the command line, so I could get the path from both files before starting the script
10+
911
if len(argv) == 1:
1012
xmlPath = input("please enter the path to your XML file: ")
1113
csvPath = input("please enter the path to your CSV file: ")
@@ -18,7 +20,7 @@
1820

1921
print("started to convert your file...")
2022

21-
# from line 27 to 31
23+
# from line 29 to 33
2224
# I read the file from the xmlPath variable, and got the dictory from parseXML
2325
# After that I got the first key from the dict (asumming the user passed a single xml liked the test.xml file)
2426
# After that I got the list of nodes inside the "root"
@@ -35,7 +37,7 @@
3537
csvWriter = CSVWriter(csvFile)
3638

3739

38-
# from line 44 to 51
40+
# from line 46 to 53
3941
# I iterated over all the items on the child of the file root
4042
# After that i made the variable item into a real dict so I could use
4143
# .keys and .values, the keys for the header row

0 commit comments

Comments
 (0)