How is possible to input text selected outside of my python program to lets say a text file...
Retrieving selected text from outside.
Started by estro, Oct 19 2008 07:54 PM
7 replies to this topic
#1
Posted 19 October 2008 - 07:54 PM
|
|
|
#2
Posted 21 October 2008 - 03:44 AM
estro said:
How is possible to input text selected outside of my python program to lets say a text file...
What do you mean text selected outside?
http://logickills.org
Science - Math - Hacking - Tech
Science - Math - Hacking - Tech
#3
Posted 21 October 2008 - 04:58 PM
LogicKills said:
What do you mean text selected outside?
#4
Posted 30 October 2008 - 06:27 PM
I know its possible with pygame to get what's in the clipboard, I know it works in WinXP, so I guess its possible if you play with the windows librairies, and since Python is very versatile, some lib already surely exists.
#5
Posted 31 October 2008 - 12:49 AM
Yes, you can do this with Python. Since Python is used for
"Getting data from a keyboard, a file, or some other device"
Source: Text files: iterating over the lines in the file : Text File Read*«*File*«*Python
Go to this site and read. It tells you all the many different ways you can have it read from a text file:)
"Getting data from a keyboard, a file, or some other device"
f = open("filename")
while 1:
line = f.readline()
if not line: break
#process(line)
f.close()
Source: Text files: iterating over the lines in the file : Text File Read*«*File*«*Python
Go to this site and read. It tells you all the many different ways you can have it read from a text file:)

+Friend Me | My Graphics | Forum Rules | Help Forum | Forum FAQ
#6
Posted 31 October 2008 - 05:29 AM
I think he meant getting things from the clipboard, you know CTRL+C, CTRL+V, the famous copy&paste :) .
Or actually he didn't, since with his openoffice example he is talking about taking the selected text, which is I guess a "variable" contained in openoffice, then I guess, it's up to interprocess communication, but I doubt openoffice supports that, you can always search in the doc...
Or actually he didn't, since with his openoffice example he is talking about taking the selected text, which is I guess a "variable" contained in openoffice, then I guess, it's up to interprocess communication, but I doubt openoffice supports that, you can always search in the doc...
#7
Posted 31 October 2008 - 08:00 AM
I am sure if he reads the site I linked him it will answer his questions:)

+Friend Me | My Graphics | Forum Rules | Help Forum | Forum FAQ
#8
Posted 12 April 2009 - 07:37 PM
Donovan said:
I am sure if he reads the site I linked him it will answer his questions:)
You didn't get me right. I'll try to explain myself another time. Lets say my Python program created a wx.Frame(window). Now the user selects some text outside of my program wx.Frame(window). How can I get my hand on that text?


Sign In
Create Account

Back to top









