-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathconsole-variables.py
More file actions
28 lines (23 loc) · 740 Bytes
/
console-variables.py
File metadata and controls
28 lines (23 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
import aiomonitor
async def main():
loop = asyncio.get_running_loop()
data = {
"a": 123,
"b": 456,
}
with aiomonitor.start_monitor(loop=loop) as monitor:
monitor.console_locals["data"] = data
print("Now you can connect with:")
print(f" python -m aiomonitor.cli -H {monitor.host} -p {monitor.port}")
print("or")
print(f" telnet {monitor.host} {monitor.port} # Linux only")
print("\nTry 'console' command and inspect 'data' variable.")
# run forever until interrupted
while True:
await asyncio.sleep(60)
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
pass