How to Make a Python Command Sending You to a link? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

How to Make a Python Command Sending You to a link?

I need a statement sending you to a link, "if the q key is pressed" Thanks!

11th Jun 2020, 5:05 PM
Gigabyte Masters
Gigabyte Masters - avatar
2 ответов
+ 3
You can use python keyboard module to interact with your keyboard and add hotkeys to your computer for example write a code which when "q" is pressed call a function and that function run the code on system shell with os or subprocess python standard library module which run the browser and pass the link to that as a argument for example in linux(i'm not familiar with cmd): firefox youtube.com If you enter this on linux terminal it will open youtube.com This is the keyboard module link: https://github.com/boppreh/keyboard You can find tutorial about keyboard module in internet also this command install the keyboard on your python: pip install keyboard
11th Jun 2020, 6:08 PM
Sadness
Sadness - avatar
0
Thank you!
12th Jun 2020, 1:25 PM
Gigabyte Masters
Gigabyte Masters - avatar