M
M
Mr. Anderson2020-06-01 05:52:20
Python
Mr. Anderson, 2020-06-01 05:52:20

Is it possible to implement auto login and password entry in Python?

Good day to all.

Is it possible in Python to implement login and password input by pressing key combinations, for example?

I run the program as administrator, the UAC window appears, I press the key combination and the cursor gets into the first Edit and enters the login, then presses for example TAB and the cursor gets into the second Edit, enters the password and then presses ok. Are there examples of such implementations? On the day, I enter the login and password 40-50 times. It's already starting to creep up.

PS Be healthy. Take care of yourself and loved ones!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-06-01
@roman_tonkoshkurov

It is possible, for example

pip install keyboard

import keyboard
import time


while True:

    if keyboard.read_key(suppress=True) == 'f1':
        keyboard.write('Login')
        time.sleep(0.1)
        keyboard.send('tab')
        time.sleep(0.1)
        keyboard.write('Pass')
        time.sleep(0.1)
        keyboard.send('enter')

Will AutoHotKey work?
F1::
Send login
Sleep, 100
Send {Tab}
Sleep, 100
Send password
Sleep, 100
Send {Enter}
return

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question