def test_flush(self): screen = Screen() # standard printf will buffer, so output won't come until newline screen.println('The next line should print all at once...') for i in range(0, 40): screen.printf('.') time.sleep(0.5) screen.println() # now flush after each dot screen.println('The next line should print smoothly...') for i in range(0, 40): screen.printf('.') screen.flush() time.sleep(0.5) screen.println()
def test_printf(self): screen = Screen() screen.printf('single message.') screen.printf( 'this should be on ame line as above. explicit newline: \n') screen.printf('this', 'is', 'a', 'list', 'message') screen.printf('same line as list message', 'explicit newline: \n') screen.printf('this is a %s message.\n' % 'printf-style') screen.printf('this is a {0} message.\n'.format('format-style'))