Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a spinner #53

Open
MartinThoma opened this issue Oct 9, 2018 · 1 comment
Open

Add a spinner #53

MartinThoma opened this issue Oct 9, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@MartinThoma
Copy link
Owner

import itertools, sys, time
spinner = itertools.cycle(['-', '/', '|', '\\'])
while True:
    sys.stdout.write(spinner.next())  # write the next character
    sys.stdout.flush()                # flush stdout buffer (actual character display)
    sys.stdout.write('\b')            # erase the last written char
    time.sleep(0.1)
@MartinThoma MartinThoma added the enhancement New feature or request label Oct 9, 2018
@MartinThoma
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant