A
A
Aristarkh Deryapa2017-10-18 19:01:46
Python
Aristarkh Deryapa, 2017-10-18 19:01:46

Python multiprocessing?

Hello! How to make a program in Python 3.4.2 (Win 7 x32) that asks for a password to access "super rights", but after 5 seconds it just continues to work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aristarkh Deryapa, 2017-10-18
@SelfiAS

All problem solved.

import threading
import time

def waiter():
    time.sleep(2)
    exit(1)

if __name__ == "__main__":
    print("BOOT")

    t = threading.Thread(target=waiter)
    t.daemon = True
    t.start()

    code = input("> ")
    if code == "12345":
        print("super user access enabled")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question