mirror of
https://github.com/bvanroll/startrek-ml.git
synced 2025-08-28 19:42:50 +00:00
29 lines
557 B
Python
29 lines
557 B
Python
import json
|
|
import sys, os
|
|
Cast = {}
|
|
|
|
string = sys.argv[1]
|
|
temp = ""
|
|
arrayOfStrings = []
|
|
space = " "
|
|
for x in range(0, 100):
|
|
arrayOfStrings.append(space)
|
|
space = space+" "
|
|
|
|
|
|
|
|
with open(string, "r") as infile:
|
|
fileNaam=infile.read().replace('\n', ' ')
|
|
array=fileNaam.split()
|
|
arrayFromCast = array[array.index("CAST")+1:]
|
|
Cast=arrayFromCast[:arrayFromCast.index("STAR")];
|
|
|
|
|
|
|
|
|
|
with open('output.json', 'w+') as outfile:
|
|
json.dump(Cast, outfile)
|
|
with open('Temp.txt', 'w+') as outfile:
|
|
outfile.write(temp)
|
|
outfile.close()
|