Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmp-p/aioprompt
minimal py3.7+ asyncio repl using readline module tricks.
https://github.com/pmp-p/aioprompt
asyncio panda3d python3 repl
Last synced: 7 days ago
JSON representation
minimal py3.7+ asyncio repl using readline module tricks.
- Host: GitHub
- URL: https://github.com/pmp-p/aioprompt
- Owner: pmp-p
- Created: 2018-11-14T08:23:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T23:01:32.000Z (over 4 years ago)
- Last Synced: 2024-10-29T13:45:44.771Z (about 2 months ago)
- Topics: asyncio, panda3d, python3, repl
- Language: Python
- Size: 70.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aioprompt
minimal py3.6+ repl for asyncio using **readline module** tricks. That module is often available on GNU/Linux platform.
tests are made on 3.7, but 3.6 should be fine too except for certains "await" syntax use. eg f'{await test()}' would not work on 3.6
Testing:
```
$ git clone https://github.com/pmp-p/aioprompt.git
$ cd aioprompt
$ PYTHONPATH=. python3.7 -i -maioprompt
```The main test will launch a clock on your repl ( use a VT100 utf-8 compatible terminal ).
![Preview1](./aioprompt.png)
aio.* ( which actually is the asyncio loop) namespace provides pause/resume/step/run functions to control async loop
and add coroutines.you can also import them in repl with from aioprompt import * and use them directly
"loop", "close", "create_task", "pause", "resume", "step"
"schedule" is a special function that mimic micropython.schedule function using PyOS_InputHook from readline module.
to add a task just use : aio.create_task( the_task() )
or run(the_task)## Panda3D
if you have Panda3D engine installed, you can try it async with:
```
>>> import aioprompt.panda3d
```![Preview1](./async_panda3d.png)
Quite usefull via ssh for debugging fullscreen game, or simulating Panda3D webgl browser port on your desktop !
refresh rate will be slow but that's expected, actually cpython readline module does not allow to set it
see https://bugs.python.org/issue35243
## known bugs
multiline triple """ ''' """ quoted str would fail because not using decent parser.