with repr value as comment
Project description
pycomment
Inserting repr value on comment with marker (marker is # =>). This is heavily inspired by xmpfilter of ruby’s rocodetools
install
warning: in the future (not yet)
$ pip install pycomment
how to use
code.py
import sys
print("stderr", file=sys.stderr)
print("hello")
1 + 2 + 3 + 3 + 4 + 5 # =>
1 + 2 + 3 + 3 + 4 + 5 # =>
print("bye")
$ pycomment --inplace code.py
import sys
print("stderr", file=sys.stderr)
print("hello")
1 + 2 + 3 + 3 + 4 + 5 # => 18
1 + 2 + 3 + 3 + 4 + 5 # => 18
print("bye")
# -- stdout --------------------
# >> hello
# >> bye
multi-line output
import numpy as np
np.arange(9).reshape((3, 3)) # => multi-line..
# array([[0, 1, 2],
# [3, 4, 5],
# [6, 7, 8]])
# ..multi-line
0.0.4:
multi-line output suppor (#12)
-i option is added, same as –inplace (#7)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycomment-0.0.5.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for pycomment-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5028553bd618ca809fb9d9696e292c4374ad68f0c1a582cab564fbaaf9e02301 |
|
MD5 | de9640403ae9e9c86212b9fbbf62ec59 |
|
BLAKE2b-256 | e3111a31df8d2b0c1f0517490dfc39863bdceac7f8e1a77959e9834e230e7b33 |