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.1.0
exec in tempfile, so more robust (#17)
0.0.6
multi-line output with indentation (support completely) (#14)
0.0.4:
multi-line output support (#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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pycomment-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f92628b3804cd5ca4f8f7f5b53608441337ec38d50bd7589a18c63d0acb3a8c7 |
|
MD5 | 2049f2e3c157826ac339607a8024a361 |
|
BLAKE2b-256 | b7063999bce004922a225b8c0948cecc7e31d9d36538d5267f7f678ee753b4d3 |