# 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] fl = open("filoXX_nF.txt", "rt") rd = fl.read() lst = rd.splitlines() with open("filoXX.js", "w") as output: output.write(str(lst)) fl.close() with open('filoXX.js', 'r') as original: data = original.read() with open('filoXX.js', 'w') as modified: modified.write("var x = " + data + ";")