Tools and things that make my life easier - y'all might like them too
peval
Evalulate a Python expression
Syntax: peval [-i|--import MODULE] expression ...
| Option | Description | Default |
| —— | ———– | ——- |
| -i
or --import
| Import a module | Since the bulk of the code is just a print statement of the arguments on the command line, this option can be used to import a Python module such as os
, path
, re
, etc. |
$ peval --import datetime 'datetime.datetime.now().isoformat()', 'range(25)'
('2018-09-25T17:07:10.967965', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24])
$
peval
to describe undesriable behavior with another tool