1

So i'm making a stupid rickroll for fun, something unoffensive only to learn python (I am a beginner) and I am wondering how to block the mouse and the keyboard temporarily so you can't close the tabs, but I don't know how. I have seen a few ways to do this, but some of them doesn't even work, and the rest use pyhook, and i've been struggling with downloading it for an hour, but I can't. Is there a way to do that in Windows that still work nowadays without using pyhook? Thanks :). Also, please let me know if I wrote something wrong (i'm from spain and I don't have a perfect English)

Here is the code of the rickroll:

import webbrowser
import time


for i in ("aaaaaaaaaaaaaaaaaaaa"):

    webbrowser.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    time.sleep(2)




print("YOU GOT RICKROLLED HAHAHAHAHA")
4
  • It is possible but requires admin rights. Commented Aug 18, 2021 at 20:08
  • @viilpe ok, no problem :) Commented Aug 18, 2021 at 20:12
  • I apologize for the wrong link, here is the correct one: stackoverflow.com/questions/8264161/can-python-use-blockinput Commented Aug 18, 2021 at 20:16
  • @viilpe ok, thanks! I posted a comment asking for the link 6 seconds before you wrote the comment, but i just deleted it hahaha. I gonna check that! Commented Aug 18, 2021 at 20:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.