Auto translator
This commit is contained in:
18
Auto Trans/Parser.py
Normal file
18
Auto Trans/Parser.py
Normal file
@ -0,0 +1,18 @@
|
||||
#Expects Renpy's dialogue.txt, spits out a original.csv file
|
||||
|
||||
import csv
|
||||
|
||||
# Open the text file for reading
|
||||
with open('dialogue.txt', 'r', encoding='utf8') as input_file:
|
||||
# Open the csv file for writing, using utf8 encoding
|
||||
with open('original.csv', 'w', newline='', encoding='utf8') as output_file:
|
||||
# Create a csv writer object
|
||||
writer = csv.writer(output_file)
|
||||
|
||||
# Iterate over the lines in the text file
|
||||
for line in input_file:
|
||||
# Strip the newline characters from the line
|
||||
stripped_line = line.strip()
|
||||
|
||||
# Write the original string and an empty string to the csv file
|
||||
writer.writerow([stripped_line, ''])
|
Reference in New Issue
Block a user