Skip to main content

function for printing text in a type writer manner

Project description

Module: typewriter

This module provides a function that prints out text in a typewriter manner

def typing(txt, text_speed=0.05):

    for char in txt:
        sys.stdout.write(char)
        sys.stdout.flush()

        if char != "\n":
            time.sleep(text_speed)

        else:
            time.sleep(text_speed + 0.3)

    else:
        sys.stdout.write("\n")
  • text: Argument that will be printing to the terminal
  • text_speed: Specifies the time taken to pause after printing each character

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leza_typewriter-1.0.0.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

leza_typewriter-1.0.0-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page