883 karma · joined June 12, 2014
The example to sort df -h by the percent:
df -h | p 'sorted({}[1:], key=lambda x: int(x.split()[-2][:-1]))'
I saved this as ~/bin/p #!/usr/bin/env python3
import sys
single_line = sys.argv[1] == '-l'
code = ' '.join(sys.argv[2 if single_line else 1:])
if single_line:
for line in sys.stdin:
print(eval(code.format('line.strip()')))
else:
print('\n'.join(eval(code.format('sys.stdin.read().splitlines()'))))At a previous job I utilized these low level bindings to create higher level bindings. Used reflection of both Python and Tcl to expose themselves to each other. Was able to seamlessly use Tcl objects from Python and vice versa.
This is not an answer. Talk to sales?
I don't mind paying for support. I'm not a fan of paying for enterprise features. I would never want a dependency to something which is not free.
Then you'd have Python code executed by an interpreter written in Java compiled by Graal to produce a native binary which will be registered on AWS as a Go executable and will communicate via Go's net/rpc.
... as opposed to switching the runtime to Python ;-)
https://imgur.com/gallery/oiWeZmm
Run this:
git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' 2cde51fbd0f3
To me all of those things should be Git objects as well either tracked inside the same repo on another branch or something or tracked in a parallel Git repo.
What about the implementation is interesting? Does it make heavy use of some new feature like coroutines, or something? It is supposed to be very elegant? What?
It'll effectively side-steps the recursion limit in Python. For runs under the limit anyway, it'd be interesting to see whether it's any faster. It trades function call overhead for exception handling overhead.
By the way, the first example where it has `return 1` is wrong. It shoudl `return accumulator`. Clicking the GitHub link someone suggested this in December.
C, not even C++, is still the only common denominator between languages. The fact that I cannot create a shared library in Golang or Python that is callable from the other is very disappointing.