sh 1.08 — sh v1.08 documentation

index next | sh v1.08 documentation » ¶ sh (previously pbs ) is a full-fledged subprocess interface for Python that allows you to call any program as if it were a function: from sh import ifconfig print ( ifconfig ( "wlan0" )) Output: wlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: ffff::ffff:ffff:ffff:fff/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0 GB) TX bytes:0 (0 GB) More examples: # checkout master branch git . checkout ( "master" ) # print(the contents of this directory print ( ls ( "-l" )) # get the longest line of this file longest_line = wc (...

Linked on 2014-09-30 18:44:49 | Similar Links