I have a Python script that reads text from a file, processes and saves it to new file.

When I want to process some text on a webpage I need to copy & paste to a file, save, run the script, open the second file, and finally copy to the webpage.

Is there any way to script or automate this?


you could monitor the clipboard and run a script on the text stored there when it changes.

easiest way is to just use tkinter. it will open a empty form while running though.

import tkinter as Tk
form = Tk.Tk()
previousData = form.clipboard_get()
while True:
    data = form.clipboard_get()
    if data != previousData:
        previousData = data
  • Will not this script slow down OS? – Pavel Jan 4 '17 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.