Jump to content

Python keyboard module

Go to solution Solved by Sauron,

works on my machinetm

 

but on the live interpreter I get all the characters at once (though after the sum of delays). maybe it's a bug that happens when it's running in the live interpreter?

Hey so I was using the python keyboard module that recognizes the keystrokes from your keyboard. And you know the option whre you type this and it writes out the word for you:

keyboard.write("Hello",delay=1)

there is no delay, the word gets written instantly.  I tried [1], 1 and all sorts of stuff instead of delay=1 even int=1 and other crap , there is no delay.  I want a delay after every character so it looks like it's writing it slowly. I even tried writing every character with a separate command,  no delay. Hiw do I do that?

 

Link to comment
https://linustechtips.com/topic/1450776-python-keyboard-module/
Share on other sites

Link to post
Share on other sites

Works just fine on my end. Where are you trying to write something to?

 

image.thumb.gif.e25682d34b914a37ab595a89dd498e95.gif

And now a word from our sponsor: 💩

ℑ𝔣 𝔶𝔬𝔲 𝔬𝔫𝔩𝔶 𝔫𝔬𝔱𝔦𝔠𝔢 𝔭𝔢𝔯𝔣𝔬𝔯𝔪𝔞𝔫𝔠𝔢 𝔭𝔯𝔬𝔟𝔩𝔢𝔪𝔰 𝔴𝔥𝔢𝔫 𝔶𝔬𝔲 𝔥𝔞𝔳𝔢 𝔞 𝔰𝔱𝔞𝔱 𝔠𝔬𝔲𝔫𝔱𝔢𝔯 𝔬𝔳𝔢𝔯𝔩𝔞𝔶 𝔞𝔠𝔱𝔦𝔳𝔢, 𝔶𝔬𝔲 𝔞𝔯𝔢 𝔪𝔢𝔯𝔢𝔩𝔶 𝔩𝔬𝔬𝔨𝔦𝔫𝔤 𝔣𝔬𝔯 𝔭𝔯𝔬𝔟𝔩𝔢𝔪𝔰 𝔱𝔬 𝔟𝔢 𝔲𝔭𝔰𝔢𝔱 𝔬𝔳𝔢𝔯. 𝔗𝔲𝔯𝔫 𝔬𝔣𝔣 𝔱𝔥𝔢 𝔠𝔬𝔲𝔫𝔱𝔢𝔯 𝔟𝔢𝔣𝔬𝔯𝔢 𝔞𝔰𝔨𝔦𝔫𝔤 𝔣𝔬𝔯 𝔥𝔢𝔩𝔭 𝔞𝔫𝔡 𝔰𝔢𝔢 𝔦𝔣 𝔶𝔬𝔲 𝔰𝔱𝔦𝔩𝔩 𝔫𝔬𝔱𝔦𝔠𝔢.

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

Link to comment
https://linustechtips.com/topic/1450776-python-keyboard-module/#findComment-15533778
Share on other sites

Link to post
Share on other sites

works on my machinetm

 

but on the live interpreter I get all the characters at once (though after the sum of delays). maybe it's a bug that happens when it's running in the live interpreter?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
https://linustechtips.com/topic/1450776-python-keyboard-module/#findComment-15533779
Share on other sites

Link to post
Share on other sites

12 hours ago, Sauron said:

works on my machinetm

 

but on the live interpreter I get all the characters at once (though after the sum of delays). maybe it's a bug that happens when it's running in the live interpreter?

Yeah I think.  I use pycharm and in the terminal there it doesn't work.  Maybe there is a bug and it doesn't work on all things. That's fine I guess I will use it if it works, if not I will just make the text that writes itself in a more complicated way

Link to comment
https://linustechtips.com/topic/1450776-python-keyboard-module/#findComment-15534584
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×