mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 05:05:22 +01:00
Introduced QuestyMAN! A tool that helps adding new questions!
This commit is contained in:
parent
31d41f38ce
commit
0734651db1
1 changed files with 22 additions and 0 deletions
22
questyman.py
Normal file
22
questyman.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# A python helper tool to generate questions with the directory tree format
|
||||
|
||||
import os
|
||||
|
||||
prefix = input("Specify a prefix (default is no prefix): ")
|
||||
separator = input("Specify a separator (default is no separator): ")
|
||||
current = int(input("Number of the next question: "))
|
||||
path = input("Specify the path: ")
|
||||
|
||||
while True:
|
||||
dirname = path + "/" + prefix + separator + str(current)
|
||||
os.mkdir(dirname)
|
||||
open(dirname + "/quest.txt", 'a').close()
|
||||
os.system("\"" + dirname + "/quest.txt" + "\"")
|
||||
open(dirname + "/correct.txt", 'a').close()
|
||||
os.system("\"" + dirname + "/correct.txt" + "\"")
|
||||
open(dirname + "/wrong 1.txt", 'a').close()
|
||||
os.system("\"" + dirname + "/wrong 1.txt" + "\"")
|
||||
open(dirname + "/wrong 2.txt", 'a').close()
|
||||
os.system("\"" + dirname + "/wrong 2.txt" + "\"")
|
||||
|
||||
current += 1
|
Loading…
Reference in a new issue