Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1007 Bytes

README.md

File metadata and controls

55 lines (39 loc) · 1007 Bytes

opy: onelinerers' Python

a Python wrapper that works like AWK or rb command

Build Status

example of use

$ seq 3 | opy '[math.sin(F1)]'
0.8414709848078965
0.9092974268256817
0.1411200080598672

install

make

The opy file and its manual are copied to /usr/local/bin/ and /usr/local/share/man/man1/ respectively with the following command.

$ sudo make install

homebrew

$ brew tap ryuichiueda/oneliner-python
$ brew install oneliner-python

options

  • --help: show help
  • -m <modules>: load modules
  • -s: string mode
    • prohibit automatic number conversions.
  • -i, -o: input/output field separator
$ echo '1,2,3,4,5' | opy -i , '[F2]'
2
$ echo '1,2,3,4,5' | opy -i , -o x '[F2,F3,F4]'
2x3x4
  • -I: regex input field separator
$ echo a33b313c | tr ' ' , | opy -I '\d+' '[*F[1:]]'
a b c