środa, 3 lipca 2013

python - shell command execute

1. install python-pip - alternative Python package installer
2. pip install sh - install sh module
3. from python shell:


>>> import sh

print sh.ifconfig("wlan0")

>>> from sh import ifconfig

print ifconfig("wlan0")

# print the contents of this directory

>>> print ls ("-ltr")

razem 4 -rw-r--r-- 1 root root 28 lip 2 14:28 plik.tajemny 

Brak komentarzy:

Prześlij komentarz