How to use getch - 10 common examples

To help you get started, we’ve selected a few getch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coffeemug / ankify / ui.py View on Github external
def pick_image():
    sys.stdout.write("Image number 1-8 (or 'q') ")
    sys.stdout.flush()
    while True:
        res = getch()
        if res.isdigit():
            res = int(res)
            if res in range(1,9):
                print()
                return int(res)
        else:
            if res == 'q':
                print()
                return None
github sanjeethboddi / DiscoSnake / game.py View on Github external
def main():
    init(autoreset=True)
    os.system('cls' if os.name == 'nt' else 'clear')
    print("\t \t Snake")
    print("==============")
    print("W - to move up")
    print("S - to move down")
    print("A - to move left")
    print("D - to move right")
    print("==============")
    while True:
            print('press Y to Start the game and N to exit:  ',end="")
            x = getch.getche()
            print("")
            if x== 'Y' or x=='N' or x=='y' or x=='n':
                break
            else:
                print("wrong input try again")
    if x=='n' or x=='N':
        sys.exit()
    game_over = multiprocessing.Value('i')
    game_over.value = 0
    direction = multiprocessing.Value('i')
    direction.value=ord('D')
    moved = multiprocessing.Value('i')
    moved.Value=0
    lock = multiprocessing.Lock()
    process1=multiprocessing.Process(target=dir_input,args=(direction,game_over,lock,moved))
    process2=multiprocessing.Process(target=game_start,args=(direction,game_over,lock,moved))
github AdrMXR / KitHack / lib / kitools.py View on Github external
def Zphisher():
	location = os.getcwd()
	if not os.path.isdir('tools/Phishing/zphisher'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Phishing && git clone https://github.com/htr-tech/zphisher.git && cd zphisher && chmod +x zphisher.sh')
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Phishing/zphisher".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()
		else:
			os.system('cd tools && cd Phishing && cd zphisher && bash zphisher.sh')	 	
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def Spykey():
	location = os.getcwd()
	if not os.path.isdir('tools/Windows/spykey'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Windows && git clone https://github.com/thelinuxchoice/spykey.git')	
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Windows/spykey".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()		
		else:
			os.system('cd tools && cd Windows && cd spykey && bash spykey.sh')
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def Hashcat():
	location = os.getcwd()
	if not os.path.isdir('tools/Passwords/hashcat'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Passwords && git clone https://github.com/hashcat/hashcat.git && cd hashcat && make && sudo make install')
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Passwords/hashcat".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()
		else:
			os.system('hashcat -h')	
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def KnockMail():
	location = os.getcwd()
	if not os.path.isdir('tools/Others/KnockMail'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Others && git clone https://github.com/4w4k3/KnockMail.git && cd KnockMail && sudo su && pip install -r requeriments.txt')
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Others/KnockMail".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()
		else:
			os.system('cd tools && cd Others && cd KnockMail && python knock.py')		
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def SQLmap():
	location = os.getcwd()
	if not os.path.isdir('tools/Web/sqlmap-dev'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Web && git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev')
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Web/sqlmap-dev".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()
		else:
			os.system('cd tools && cd Web && cd sqlmap-dev && python sqlmap.py -h')
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def QRLjacker():
	location = os.getcwd()
	if not os.path.isdir('tools/Others/QRLJacking'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('sudo apt-get install python3.7 && cd tools && cd Others && git clone https://github.com/OWASP/QRLJacking.git && cd QRLJacking && cd QRLJacker && pip install -r requirements.txt')
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Others/QRLJacking".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()
		else:
			os.system('cd tools && cd Others && cd QRLJacking && cd QRLJacker && python3 QrlJacker.py')
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def AndroidExploits():
	location = os.getcwd()
	if not os.path.isdir('tools/Android/Android-Exploits'):	
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Android && git clone https://github.com/sundaysec/Android-Exploits.git')
		print("\n{0}[✔] Done.{1}\nExploits guardados en {2}/tools/Android/Android-Exploits".format(GREEN, DEFAULT, location))
		pause("\n{}Presione una tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()	
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()
github AdrMXR / KitHack / lib / kitools.py View on Github external
def Ransomware():
	location = os.getcwd()
	if not os.path.isdir('tools/Others/ransomware'):
		print("\n{0}[*] Downloading tool...{1}".format(GREEN, DEFAULT))
		time.sleep(4)
		os.system('cd tools && cd Others && mkdir ransomware && cd ransomware && wget https://www50.zippyshare.com/d/AXhWKmtC/45706/ransomware.zip && unzip ransomware.zip')
		print("\n{0}[✔] Done.{1}\nHerramienta guardada en {2}/tools/Others/ransomware".format(GREEN, DEFAULT, location))
		if raw_input("\n{0}[!] ¿Desea ejecutarla? (y/n)\n{1}KitHack >>{2} ".format(GREEN, RED, DEFAULT)).upper() != "Y":
			os.system('clear')
			KitHack.banner(), KitHack.menu(), KitHack.options()
		else:
			os.system('cd tools && cd Others && cd ransomware && python ransomware.py -v')	 
	else:
		print("\n{}[X] Esta herramienta ya existe...".format(RED))
		time.sleep(2)
		pause("\n{}Presione cualquier tecla para continuar...".format(GREEN))
		os.system('clear')
		KitHack.banner(), KitHack.menu(), KitHack.options()

getch

Does single char input, like C getch/getche

Public-Domain
Latest version published 12 years ago

Package Health Score

43 / 100
Full package analysis