[opensuse-factory] Presenting python-sh
Hello openSUSE I would like to include python-sh into Factory. python-sh is a Python library that allows you to interact with the shell script. You can call any external application from Python, in a coherent way. For example import sh print sh.ls('-l', '-a') print sh.pwd() This will call `ls -l -a` and `pwd` and print the result in the console. Is powerful and really convenient when you want to replace shell scripts with a more productive language. If no one is against this, I would like to create the request the next Monday. Thanks, Alberto Planas -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 2015-01-30 at 15:35 +0100, Alberto Planas Dominguez wrote:
Hello openSUSE
I would like to include python-sh into Factory. python-sh is a Python library that allows you to interact with the shell script. You can call any external application from Python, in a coherent way. For example
import sh print sh.ls('-l', '-a') print sh.pwd()
This will call `ls -l -a` and `pwd` and print the result in the console. Is powerful and really convenient when you want to replace shell scripts with a more productive language.
If no one is against this, I would like to create the request the next Monday.
Sounds like a very interesting, simplified way to launch external tools. I from my part don't see why we should block this in anyway... I'd not starting 'wrapping my shell scripts in python though' :) sh.ls('-l', '-a') reads a bit nicer than call('ls', '-l', '-a'), which, essentially does the same.
Thanks, Alberto Planas
Cheers, and keep the good stuff coming! Dominique -- Dimstar / Dominique Leuenberger <dimstar@opensuse.org> -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday, January 30, 2015 03:47:38 PM Dimstar / Dominique Leuenberger wrote:
On Fri, 2015-01-30 at 15:35 +0100, Alberto Planas Dominguez wrote:
Hello openSUSE
I would like to include python-sh into Factory. python-sh is a Python library that allows you to interact with the shell script. You can call any external application from Python, in a coherent way. [...] I from my part don't see why we should block this in anyway... I'd not starting 'wrapping my shell scripts in python though' :)
sh.ls('-l', '-a') reads a bit nicer than call('ls', '-l', '-a'), which, essentially does the same.
There is more gain than that: for line in sh.tail('-f', my_log_file): if re.match(r'....', line): # Do whatever ... Also, with a bit of code you can do `ssh.ls()`
Cheers, and keep the good stuff coming!
Thanks!!
Dominique
-- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (2)
-
Alberto Planas Dominguez
-
Dimstar / Dominique Leuenberger