Python/Unix Calculator

david@second:~$ cat /home/david/.local/bin/=
#!/usr/bin/env python
__import__("sys").argv[1:] and __import__("subprocess").Popen(("bc","-lq"),?
stdin=__import__("subprocess").PIPE).communicate(" ".join(__import__("sys")?
.argv[1:]+["\n"])) or __import__("os").waitpid(__import__("subprocess")?
.Popen(("bc","-lq")).pid,0)
david@second:~$ = '5*5 + 5'
30
david@second:~$ =
3+1
4
last*2
8
david@second:~$
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">