Python way to printk?

Dan Stromberg drsalists at gmail.com
Wed Jun 9 19:22:52 EDT 2010


On Wed, Jun 9, 2010 at 3:25 PM, Thomas Jollans <thomas at jollans.com> wrote:

> On 06/09/2010 11:40 PM, J wrote:
> > Does anyone know of a way, or have a recipe, to do a linux printk
> > equivalent in Python?
> >
> > I've been googling for a while and not finding anything useful.
> >
> > The nutshell version of this is that I need to write a routine for a
> > test tool I'm working on that will time the amount of time used to
> > take a system and go from Live to Suspended and then from Suspended to
> > Live.
>
> as "News123" has said, it's probably not possible, simply because
> (AFAIK) printk is a kernel-internal function. Even if it were callable
> from user space, it would be a system call, so ctypes probably wouldn't
> help you, since that operates on shared libraries (correct me if I'm
> wrong, anyone)
>

Most system calls will have wrappers in the C library, and those wrappers
should be callable via ctypes.  However, a printk system call sounds
unlikely.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100609/8bcda3b8/attachment-0001.html>


More information about the Python-list mailing list