mirror of
https://github.com/bvanroll/startrek-ml.git
synced 2025-08-29 12:02:45 +00:00
Next up putting all scripts through this casting process
This commit is contained in:
28
Analyser.py
Normal file
28
Analyser.py
Normal file
@@ -0,0 +1,28 @@
|
||||
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()
|
Reference in New Issue
Block a user