# This script convert a txt file into a js containing an array with each line of the txt # I would like make a command from this, like > arraygen [name var] [input file] [outputfile] title = "origin_debate" fl = open(title + ".txt", "rt") rd = fl.read() lst = rd.splitlines() with open(title + ".js", "w") as output: output.write(str(lst)) fl.close() with open(title + ".js", 'r') as original: data = original.read() with open(title + ".js", 'w') as modified: modified.write("var x = " + data + ";")