Access to sysctl on FreeBSD?

Benjamin Kaplan benjamin.kaplan at case.edu
Tue May 20 12:40:37 EDT 2008


On Tue, May 20, 2008 at 12:26 PM, Skye <spoier at gmail.com> wrote:

> How do I access the sysctl(3) call from Python on BSD?
>
> Specifically I want to retrieve:
>
> $ sysctl -d net.inet.ip.stats
> net.inet.ip.stats: IP statistics (struct ipstat, netinet/ip_var.h)
>
> So I'll need some way of getting to struct ipstat from Python as well
>
> Thanks,
> Skye
>

You could use subprocess.Popen to run the command yourself and just parse
the output.

http://docs.python.org/lib/node528.html

>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080520/15fffa49/attachment-0001.html>


More information about the Python-list mailing list