auto add extension to output name
This commit is contained in:
12
main.py
12
main.py
@@ -3,7 +3,17 @@ import csv
|
|||||||
|
|
||||||
def main(file_format, input, output):
|
def main(file_format, input, output):
|
||||||
|
|
||||||
with open(input, newline='') as csvfile, open(output, "w") as out:
|
output_file_format = ""
|
||||||
|
|
||||||
|
match file_format:
|
||||||
|
case "gpl":
|
||||||
|
output_file_format = f"{output}.gpl"
|
||||||
|
case "scribus":
|
||||||
|
output_file_format = f"{output}.xml"
|
||||||
|
case: "krita":
|
||||||
|
output_file_format = f"{output}.kpl"
|
||||||
|
|
||||||
|
with open(input, newline='') as csvfile, open(output_file_format, "w") as out:
|
||||||
code_reader = csv.reader(csvfile, delimiter=',')
|
code_reader = csv.reader(csvfile, delimiter=',')
|
||||||
next(code_reader)
|
next(code_reader)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user