<s> import sys <EOL> import time <EOL> import multiprocessing <EOL> DELAY = <NUM_LIT:0.1> <EOL> DISPLAY = '<STR_LIT>' <EOL> def spinner_func ( before = '<STR_LIT>' , after = '<STR_LIT>' ) : <EOL> write , flush = sys . stdout . write , sys . stdout . flush <EOL> while True : <EOL> for char in DISPLAY : <EOL> msg = '<STR_LIT>' . format ( before , char , after ) <EOL> write ( msg ) <EOL> flush ( ) <EOL> write ( '<STR_LIT>' * len ( msg ) ) <EOL> time . sleep ( DELAY ) <EOL> def long_computation ( ) : <EOL> time . sleep ( <NUM_LIT:3> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> spinner = multiprocessing . Process ( <EOL> None , spinner_func , args = ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> spinner . start ( ) <EOL> try : <EOL> long_computation ( ) <EOL> print ( '<STR_LIT>' ) <EOL> finally : <EOL> spinner . terminate ( ) </s>
