3 ms·
> What? Numpy does this. And Numpy needs an ad-hoc grafted on type system(s) to do it. > Show me an example of this system code that's nice in julia and clunk
by tavert 9y ago
> What? Numpy does this.
And Numpy needs an ad-hoc grafted on type system(s) to do it.
> Show me an example of this system code that's nice in julia and clunky in python and I'll show you a superior implementation in python.
Silly over-reduction, but show me a nice way of running this in Python in 3 lines:
run(`./configure`)
run(`make`)
run(`make install`)
- fnord123 9y agoos.system('./configure') os.system('make') os.system('make install')
- shele 9y agoI am curious (coming from Julia), what is the difficulty in Python?
- fnord123 9y agoThere's no problem but if you want to shell out there are a few ways to do it to make sure you're in control of the subshell. At the simplest there's: import os os.system('command') Then you might want to capture stdout and stdin or interact with the subshell (e.g. hitting 'y'). So you use: import subprocess cmd = subprocess.Popen("cat <(head tmp)", shell=True, stdout=subprocess.PIPE) stdout, _ = cmd.communicate() And if you want to timeout or parse logs or whatever, you go from there and it gets more and more complicated. If Julia has solved this then the community should be advertising this above all the alleged performance stuff.