Articles
Screencasts
Exercises
Python
Tips
Tools
Python Pastebin
Online Python REPL
strptime
undataclass
Python Glossary
Python Jumpstart
/
Sign Up
Sign In
Simple stripes scroll art example.
Editable Code
"""Simple stripes scroll art example.""" from itertools import cycle from shutil import get_terminal_size from time import sleep cols, rows = get_terminal_size() width = 10 for shift in cycle(range(width)): start = " " * shift pattern = "╲" + (" " * (width-1)) row = start + (pattern * 100) # 100 is way more than we'll need print(row[:cols]) # Print the exact number of characters needed sleep(0.10)
Copy Output
211 views
Copy
Code copied
Run
in Browser
pym.dev/p/36z2e/
URL copied
Need to share some Python code?
New Python snippet