How to use the yaspin.yaspin function in yaspin

To help you get started, we’ve selected a few yaspin 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 pavdmyt / yaspin / examples / demo.py View on Github external
def right_spinner(sleep=2):
    with yaspin(text="Right spinner", side="right", color="cyan") as sp:
        time.sleep(sleep)

        # Switch to left spinner
        sp.side = "left"
        sp.text = "Left spinner"

        time.sleep(sleep)
github pavdmyt / yaspin / examples / colors.py View on Github external
def colored_finalizer():
    with yaspin(text="Processing...", color="yellow") as sp:
        time.sleep(2)
        sp.ok("☀️")
github pavdmyt / yaspin / examples / finalizers.py View on Github external
def custom_finalizers():
    with yaspin(text="Processing...") as sp:
        time.sleep(2)
        # Make finalizer green
        sp.green.ok("✔")

    with yaspin(text="Processing...") as sp:
        time.sleep(2)
        # Make finalizer red
        sp.red.fail("✘")
github pavdmyt / yaspin / examples / basic_usage.py View on Github external
def context_manager_default():
    with yaspin(text="Braille"):
        time.sleep(3)
github pavdmyt / yaspin / examples / advanced_colors.py View on Github external
def ball():
    # Set with arguments
    with yaspin(
        color="white",
        on_color="on_magenta",
        attrs=["dark", "blink", "concealed"],
    ).bouncingBall as sp:
        sp.text = "Dark blink concealed white ball on magenta color"
        time.sleep(5)
github pavdmyt / yaspin / examples / finalizers.py View on Github external
def default_finalizers():
    with yaspin(text="Downloading...") as sp:
        time.sleep(2)
        sp.ok()

    with yaspin(text="Downloading...") as sp:
        time.sleep(2)
        sp.fail()
github pavdmyt / yaspin / examples / signals.py View on Github external
def ignore_signal():
    with yaspin(
        sigmap={signal.SIGINT: signal.SIG_IGN}, text="You can't interrupt me!"
    ):
        time.sleep(5)
github urish / ml-comments-gen / model / prepare.py View on Github external
@yaspin(text="Plotting word embeddings...")
def plot_embeddings(model, df, filename):
    tsne_plot(model, df, filename)