| | |
win32clipboard problem
![]() |
•
•
Join Date: Jun 2008
Posts: 3
Reputation:
Solved Threads: 0
Hello,
I have a weird problem... When I use the clipboard, code runs without error.
Attempt to paste directly after run in any application does not work.
Pasting in the python shell works fine.
After pasting in the python shell, pasting in any other application works fine !!!
Need help fast...
Thanks...
(working with python 2.5 on Vista...)
code (justed picked of the web)
import win32clipboard
def txtToClipboard(iTxt):
win32clipboard.OpenClipboard(0)
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(iTxt)
win32clipboard.CloseClipboard
txtToClipboard('blahblah')
I have a weird problem... When I use the clipboard, code runs without error.
Attempt to paste directly after run in any application does not work.
Pasting in the python shell works fine.
After pasting in the python shell, pasting in any other application works fine !!!
Need help fast...
Thanks...
(working with python 2.5 on Vista...)
code (justed picked of the web)
import win32clipboard
def txtToClipboard(iTxt):
win32clipboard.OpenClipboard(0)
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(iTxt)
win32clipboard.CloseClipboard
txtToClipboard('blahblah')
Works great with an XP, so it could be Vista that srews things up.
python Syntax (Toggle Plain Text)
# send text to the clipboard import win32clipboard def txtToClipboard(iTxt): win32clipboard.OpenClipboard(0) win32clipboard.EmptyClipboard() win32clipboard.SetClipboardText(iTxt) win32clipboard.CloseClipboard txtToClipboard('text to paste') # test # or use paste in the editor window data = win32clipboard.GetClipboardData() print data
drink her pretty
![]() |
Other Threads in the Python Forum
- Previous Thread: Regex for re.match not working as expected.
- Next Thread: Grouping strings by prefixes
| Thread Tools | Search this Thread |
abrupt accessdenied anti apache application approximation argv array beginner book builtin calculator change converter countpasswordentry curved dan08 dictionaries dictionary dynamic edit enter examples file float format function gui heads homework import inches input java keyboard lapse launcher library line lines linux list lists loop microphone mouse movingimageswithpygame mysqlquery newb number numbers numeric output parameters parsing path phonebook plugin port prime programming projects py2exe pygame pyopengl python random recursion redirect remote reverse scrolledtext session simple software sprite statictext statistics string strings syntax table terminal text textarea threading time tlapse trick tuple tutorial twoup ubuntu unicode unit urllib urllib2 variable wordgame wxpython






