repl.it
@Str0b3/

Keypress Experiment

Python

No description

fork
loading
Files
  • main.py
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from replit import clear
from sys import stdout 
import time
from readchar import readkey
def newinput(prompt): 
  stdout.write(prompt)
  stdout.flush()
  return str(readkey())
def keypress():
	c=newinput("Press any key.\n")
	if c == " ":
		print("You pressed the space key.")
	elif c == ".":
		print("You pressed the period key.")
	elif c == ";":
		print("You pressed the semicolon key.")
	elif c == ":":
		print("You pressed the colon key.")
	elif c == "'":
		print("You pressed the apostrophe key.")
	else:
		print("You pressed the " + c + " key.")
time.sleep(0.7)
print("Hello, and welcome to an experiment by @Str0b3.  Thanks to @PYer for some code.")
time.sleep(5)
keypress()
time.sleep(3)
clear()
Fetching token
?