import sys import time def print_with_pause(some_text=''): print(some_text) sys.stdout.flush() time.sleep(0.6) print("\n") for _ in range(5): print(".", end="") sys.stdout.flush() time.sleep(0.3) print_with_pause() print("Hello, World!") print_with_pause() print_with_pause() print_with_pause() print_with_pause("I am a Gist console on PythonAnywhere") print_with_pause() print_with_pause("I am running the code from a gist stored on github") print_with_pause() print_with_pause() print_with_pause() print_with_pause( "Why would you want me? Well, maybe you want to share a bit of " "code with someone, but you also want them to be able to try it out in " "a console" ) print_with_pause("You might use it to post solutions to StackOverflow questions for example..") print_with_pause("Or maybe you've written a mini-library you want to show off on your website") print_with_pause("Or a tutorial perhaps... who knows?") print_with_pause() print_with_pause() print_with_pause( "I am running in a fairly fully-featured linux sandbox. There's a filesystem..." ) print_with_pause("Here is os.listdir('.') and os.listdir('/')") import os print_with_pause(os.listdir('.')) print_with_pause(os.listdir('/')) print_with_pause() print_with_pause() print_with_pause( "I can access the Internet (via a proxy server with a whitelist)..." ) print_with_pause() print_with_pause( "And I can access all the pre-installed modules supported by PythonAnywhere" ) print_with_pause() print_with_pause( "When I finish loading the default code from the gist, I leave the user " "in interactive mode so they can play around" ) print_with_pause() print_with_pause( "Try me now! You're in an IPython shell, so things will tab-complete" ) print_with_pause( "Here's a few functions I'm making available to you\n" " get_google_news_homepage()\n" " show_batteries_included(python_version=2.7)\n" " schemers_easter_egg()\n" ) print_with_pause() print_with_pause() print_with_pause( "And check the info bar on the left for instructions on how to make your own Gist consoles" ) from extra_functions import get_google_news_homepage, show_batteries_included, schemers_easter_egg