alles,was sich so angesammelt hat
This commit is contained in:
parent
9ea4115722
commit
82d39233eb
38 changed files with 1720 additions and 0 deletions
12
txt2json.py
Normal file
12
txt2json.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
chuck_file= open(pfad + '/api/chuck.txt','r',encoding='UTF-8')
|
||||
for line in chuck_file:
|
||||
fact.append(line.strip('\n'))
|
||||
chuck_file.close()
|
||||
ran=random.randint(1,len(fact)-1)
|
||||
fakt={}
|
||||
a=0
|
||||
for i in fact:
|
||||
fakt[a]=i
|
||||
a =a +1
|
||||
with open(pfad+'/api/chuck.json', 'w',encoding='ascii') as fp:
|
||||
json.dump(fakt, fp, sort_keys=True, indent=4)
|
||||
Loading…
Add table
Add a link
Reference in a new issue