using abs paths

master
acastro 6 years ago
parent 2f3d62751a
commit f1a456227a

@ -3,17 +3,20 @@ import json, random, os
from pprint import pprint
from time import sleep
# open json files
oracle_f = open("guru.json", "r").read()
pwd = os.path.dirname( os.path.realpath(__file__) ) + "/"
oracle_f = open(pwd + "guru.json", "r").read()
oracle = json.loads(oracle_f)
rebel_f = open("rebel.json", "r").read()
rebel_f = open(pwd + "rebel.json", "r").read()
rebel = json.loads(rebel_f)
# GURU PART
keys = list( oracle.keys())
part = random.choice(keys) # choose: Repeat OR Ask Yourself
print(part)
sound_dir = "Audio_recordings/" + oracle[part]['title'] + "/"
sound_dir = pwd + "Audio_recordings/" + oracle[part]['title'] + "/"
intro = random.choice(oracle[part]['introductions'])
intro_txt = intro[0]
intro_sound = sound_dir + intro[1]

Loading…
Cancel
Save