https://github.com/octaltree/wrepl
Watch-Read-Eval-Print Loop
https://github.com/octaltree/wrepl
Last synced: 3 months ago
JSON representation
Watch-Read-Eval-Print Loop
- Host: GitHub
- URL: https://github.com/octaltree/wrepl
- Owner: octaltree
- Created: 2019-03-29T05:39:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-09T10:13:48.000Z (about 6 years ago)
- Last Synced: 2025-09-25T06:31:02.676Z (3 months ago)
- Language: Python
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WREPL
Watch-Read-Eval-Print Loop
`wrepl` is REPL wrapper. Since `wrepl` watchs file change, you can use your favorite text editor (nvim, vim, vi, etc.).
`wrepl` saves and restores global vars with [uqfoundation/dill](https://github.com/uqfoundation/dill), it is able to eval only changes.
[日本語版](https://qiita.com/octaltree/items/ea2ed58ffc740c622b6b)
## Install
```
pip install wrepl
```
## Usage
Watch with `wrepl foo.py`, edit foo.py.
## Files
It creates `foo.py.wrepl/` in executed dir for logging.
- foo.py.wrepl/last
* latest executed version of foo.py
- foo.py.wrepl/executed
* whole of snippets evaled
- foo.py.wrepl/session
* global vars persistence
## Keeping in mind
If target file is changed multi times while running snippet, only newest change is running.
Older changes is discarded.
## TODO
* preload
* on_modifiedが肥大化してるので副作用切り離してテスト
* stdout, stderrをリアルタイムにprintする
* nodeやrubyに対応