Skip to content

Commit 1ea59de

Browse files
committed
README: add an example of Python usage
1 parent 17ab348 commit 1ea59de

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ Python SIG.**
1212
Usage
1313
-----
1414

15+
``ethtool`` may be used as a Python library::
16+
17+
>>> import ethtool
18+
>>> ethtool.get_active_devices()
19+
['lo', 'enp0s31f6', 'wlp4s0', 'virbr0', 'docker0', 'virbr1', 'eth0', 'tun0']
20+
>>> ethtool.get_ipaddr('lo')
21+
'127.0.0.1'
22+
23+
``python-ethtool`` also provides the ``pethtool`` and ``pifconfig`` utilities. More example usage may be gathered from their sources,
24+
`pethtool.py <https://github.com/fedora-python/python-ethtool/blob/master/pethtool.py>`_
25+
and
26+
`pifconfig.py <https://github.com/fedora-python/python-ethtool/blob/master/pethtool.py>`_.
27+
28+
1529
``pethtool`` mimics behavior of the ``ethtool`` utility, but does not
1630
support all options.
1731

@@ -68,7 +82,7 @@ are welcome.
6882
License
6983
-------
7084

71-
``python-ethtool`` is free software put under the
85+
``python-ethtool`` is free software distributed under the terms of the
7286
GNU General Public License v2.0, see
7387
`COPYING <https://github.com/fedora-python/python-ethtool/blob/master/COPYING>`_.
7488

0 commit comments

Comments
 (0)