| | |
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 |
accessdenied advanced aliased application argv beginner bits calling casino change clear command convert corners count csv cturtle cursor def definedlines dynamic dynamically edit event events file float format frange function google homework i/o iframe inches input jaunty keyboard lapse line linux list lists loop matching microphone mouse movingimageswithpygame multiple newb number numbers numeric obexftp output parameters parsing path prime programming projects py py2exe pygame pyopengl python random rational raw_input recursion remote return reverse session signal singleton software sprite statictext string strings syntax tails text threading time tlapse tuple ubuntu unicode unit urllib urllib2 valueerror variable voip web-scrape whileloop word wxpython






