"name": "a",
"group": "a",
"pass": "a",
"ticket": ...
"_id": 123
"Question": "Answer"
"_id": 456
"Question 2": "Answer"
"_id": 789
"Question 3": "Answer"
"name": "Билет 1",
"questions": [123, 456, 789]
{
"_id": {
"$oid": "636e10187499f181ae62301a"
},
"a": {
"pupils": {
"a": {
"ticket": "Билет 2",
"passed": true,
"rezult": 1,
"passed_tickets": [
"Билет 3",
"Билет 2",
"Билет 2"
],
"repass": false
}
},
"tickets": {
"Билет 1": {
"Question": {
"type": 0,
"Answer 1": true,
"Answer 2": false,
"Answer 3": false
},
"Question 2": {
"type": 0,
"Answer 1": false,
"Answer 2": true,
"Answer 3": false
},
"Question 3": {
"type": 0,
"Answer 1": false,
"Answer 2": false,
"Answer 3": true
}
},
"Билет 2": {
"Question 1": {
"Answer 1": true,
"Answer 2": false,
"Answer 3": false,
"pictureK": 1,
"picture": "1.png",
"type": 0
},
"Question 2": {
"Answer 1": false,
"Answer 2": false,
"Answer 3": true,
"pictureK": 0,
"picture": "3.png",
"type": 0
},
"Question 3": {
"answer": "suuu1",
"pictureK": 1,
"picture": "4.png",
"type": 1
},
"Question 4": {
"answer": "suuu",
"pictureK": 0,
"picture": "2.png",
"type": 1
}
},
"Билет 3": {
"Question": {
"type": 1,
"answer": "test"
},
"Question 2": {
"type": 1,
"answer": "test1"
},
"Question 3": {
"type": 1,
"answer": "test2"
}
}
}
}
}
List poop = await coll1.Find(new BsonDocument()).ToListAsync();
group -> a
, то он пройдет дальше, т.е. ошибку из-за названия выдает, но опять же писал, что названия переменных не будут известны программе. from pynput import keyboard, mouse
from threading import Thread
def console(s):
print(s)
def check_keyboard(end: bool = False):
if end == True:
return False
else:
def on_release(key):
console(key)
return False
with keyboard.Listener(
on_release=on_release) as k_listener:
k_listener.join()
k_listener = keyboard.Listener(
on_release=on_release)
k_listener.start()
def check_mouse(end: bool = False):
if end == True:
return False
else:
def on_click(x, y, button, pressed):
console(button)
return False
with mouse.Listener(
on_click=on_click) as m_listener:
m_listener.join()
m_listener = mouse.Listener(
on_click=on_click)
m_listener.start()
keyboard100 = Thread(target = check_keyboard, daemon=True)
keyboard100.start()
mouse100 = Thread(target = check_mouse, daemon=True)
mouse100.start()
while True:
if not keyboard100.is_alive():
print("Mouse is end")
break
if not mouse100.is_alive():
print("Keyboard is end")
break
keyboard100 = Thread(target = check_keyboard, daemon=True).start()
# и также с функцией мыши
a = Thread(target=check_keyboard)
b = Thread(target=check_mouse)
a.start()
b.start()