wxTheClipboard problem, IDLE vs PythonWin

T

Tim Rice

I have a need to write data to the Windows clipboard from a Python script.
I found a nice, simple solution @
http://wiki.wxpython.org/index.cgi/ClipBoard. The problem is, I can only
get it to work from within the PythonWin and SPE IDE's. I get errors if I
try to run the exact same code from the command line or via IDLE's
interactive shell. I can't figure it out. Any ideas? Possibly something
missing from my PYTHONPATH environment variable?

Any help is appreciated. Thanks,
Tim



From PythonWin (works fine):

From IDLE (doesn't work):

From Python (command-line) (doesn't work, more verbose errors):02:17:48: Error: Failed to put data on the clipboard (error -2147221008:
coIniti
alize has not been called.)
False02:17:56: Debug: ..\..\src\msw\clipbrd.cpp(554): 'OleSetClipboard(NULL)'
failed
with error 0x00000002 (the system cannot find the file specified.).
 
T

Tom B.

Tim Rice said:
I have a need to write data to the Windows clipboard from a Python script.
I found a nice, simple solution @
http://wiki.wxpython.org/index.cgi/ClipBoard. The problem is, I can only
get it to work from within the PythonWin and SPE IDE's. I get errors if I
try to run the exact same code from the command line or via IDLE's
interactive shell. I can't figure it out. Any ideas? Possibly something
missing from my PYTHONPATH environment variable?

Idle is incompatible with wxPython, what I do when I work in Idle is just double click on the file to open it (don't use the run menu unless you have an error to look up). A programming tool I have found useful with wxPython is Leo (A literate programming tool) found at http://personalpages.tds.net/~edream/front.html


Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top