interact_module.py 593 B

12345678910111213141516
  1. from utils.configuration import Configuration
  2. def interact_module(classname,id,choices,output_type):
  3. print("'--------------------------Interact--------------------------'")
  4. for i, choice in enumerate(choices, 1):
  5. print(f"{i}:{choice}")
  6. choose_num=int(input("[选择]输入选择对应数字:"))
  7. choose=choices[choose_num-1]
  8. save_2_json(classname,id,output_type,choose)
  9. def save_2_json(classname,id,output_type,data):
  10. configuration=Configuration()
  11. file_path="Interact_"+classname+"_output.json"
  12. configuration.save_2_json(file_path,output_type,data)