logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pythonpy - 'python -c', with tab completion and shorthand

Author

       pythonpy is developed by Russell Stewart <russell.s.stewart@gmail.com>.

       This man page was written by Tiago Ilieve <tiago.myhro@gmail.com> for the Debian distribution (but it may
       be used by others).

                                                02 December 2024                                           py(1)

Bugs

       Bugs     should     be     reported     as     issues     at     the     project's      GitHub      page:
       <https://github.com/Russell91/pythonpy/issues>

Description

       pythonpy will evaluate any Python expression from the command line.

       This  will  be  done  by  the  same Python interpreter that runs it. As this version uses Python 3, it is
       compatible with Python 3 syntax only.

Examples

       Float arithmetic:

           $ py '3 * 1.5'

       Import any module automatically:

           $ py 'math.exp(1)'

       Multiply each line of input by 7:

           $ py 'range(3)' | py -x 'int(x)*7'

       Remove every file returned by the find command:

           $ find . -type f | py -x '"rm %s" % x' | sh

Name

pythonpy - 'python -c', with tab completion and shorthand

Options

-x     Treat each row of stdin as x

       -l     Treat list of stdin as l

       -cPRE_CMD
              Run code before expression-CPOST_CMD
              Run code after expression-V,--version
              Version info

       -h,--help
              Show help message and exit

See Also

python(1)

Synopsis

py [-x] [-l] [-cPRE_CMD] [-CPOST_CMD] [-V] [-h] [expression]

See Also