mekasu0124

Untitled

Feb 18th, 2024
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. @app.get("/about-questions/")
  2. async def about_questions():
  3.     aboutQuestions = []
  4.  
  5.     with open("./screen_files/about_questions.json", 'r', encoding="utf-8-sig") as f:
  6.         data = json.load(f)
  7.  
  8.         for i in data:
  9.             iden = int(i)
  10.             question = data[i]["question"]
  11.             answer = data[i]["answer"]
  12.  
  13.             aboutQuestions.append([iden, question, answer])
  14.  
  15.     return { "aboutQuestions": aboutQuestions }
Advertisement
Add Comment
Please, Sign In to add comment