Re: Where can I find good python code?

2006-10-16 Thread kdart
I think the following is a package with a lot of good code. But then,
I'm biased. ;-)

http://code.google.com/p/pynms/


On Oct 13, 9:08 am, "js " <[EMAIL PROTECTED]> wrote:
>  Hi,
>
> I've learned basics of Python and want to go to the next step.
> So I'm looking for good python examples
> I steal good techniques from.
>
> I found Python distribution itself contains some examples in Demo directory.
> I spent some time to read them and
> I think they're good but seemed not so practical to me.
> 
> Any recommendations?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting text into the copy-paste buffer...

2006-09-05 Thread kdart

David Hirschfield wrote:
> Strange request, but is there any way to get text into the linux
> copy-paste buffer from a python script ?
>
> I know the standard python libraries won't have that functionality
> (except as a side-effect, perhaps?), but is there a simple trick that
> would do it on linux? A command line to get text into the buffer? Using
> a gui toolkit as a proxy to get text in there?

There's a utility called xclip that you can wrap with popen2 or
something similar. I use my own proctools:

import proctools
XCLIP = proctools.which("xclip")
es, arg = proctools.getstatusoutput("%s -o -selection primary" %
(XCLIP,))

"arg" has the X selection.

-- 
http://mail.python.org/mailman/listinfo/python-list