简体   繁体   中英

Print terminal output on the text cursor position

Just a question out of curiosity, is it possible to print terminal output at a text cursor position. Say for example. If I print 'Hello World' in terminal, and currently my text cursor is in notepad, is there a way, on how can I get the output copied to the current positioned text cursor in real time without saving the file. Any suggestions/ help would be appreciated. If possible can we achieve this using python. Thanks.

With pyautogui you can write text with

# type with quarter-second pause in between each key
pyautogui.write('Hello world!', interval=0.25)  

This example has been taken from the docs .

Edit

With this method, you would have to manually click on the input field in which you would like the text to be written.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM