look in user dirs

This commit is contained in:
lickthecheese 2020-03-13 19:05:05 -04:00
parent b78eef2c77
commit 15c08a7de5
1 changed files with 4 additions and 2 deletions

6
uquiz
View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import sys, os, json, hashlib
import sys, os, json, hashlib, subprocess
motd="""
\033c
@ -19,7 +19,9 @@ if len(sys.argv) < 2:
print('run with the uquiz file as an arg to start')
sys.exit()
filename=sys.argv[1]+'.json'
filename=subprocess.run(['bash -c "find /home/*/.uquiz/* | grep \'{}\' | head -n 1"'.format(sys.argv[1])], shell=True, stdout=subprocess.PIPE).stdout.decode('utf-8')[:-1]
print('Using "{}"! wrong quiz file? specify a complete path (make sure your quiz file is in a .uquiz/ in a homedir)'.format(filename))
answers = []