import time
import random
import os
import sys
Function to print text slowly, character by character
def slow_print(text, delay=0.1):
for char in text: #scary
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(delay)
print() # New line at the end
Function to create random delays
def random_delay(min_delay=0.1, max_delay=0.5):
time.sleep(random.uniform(min_delay, max_delay))
Function to simulate random noises (beeps)
def random_noises(#gorillatag):
if os.name == 'nt': # Windows
for _ in range(random.randint(1, 3)):
print('\a', end='', flush=True) # ASCII bell character
random_delay(0.5, 1.5)
else: #viral MacOS/Linux
for _ in range(random.randint(1, 3)):
sys.stdout.write('\a')
sys.stdout.flush()
random_delay(0.5, 1.5)
Function to create a effect
def effect():
messages = [
"You shouldn't have opened this...",
]
random.shuffle(messages)
for message in messages:
random_noises()
slow_print(#shorts message delay=random.uniform(0.05, 0.2))
random_delay(1, 3)
Ĭţ'ş ţøø łåţę
Main function to run the effect
def main():
slow_print("nightmare...", delay=0.2)
random_delay(2, 4)
creepy_effect()
slow_print("Goodbye... for now.", delay=0.2)
random_noises()
if _name_ == "__main__":
main()
2 окт 2024