Ecco come fare per ottenere l'effetto desiderato

codice:
#!/usr/bin/env python
import sys
from time import sleep

def foo():
    for i in range(5):
        sleep(1)

sys.stdout.write("sto eseguendo foo()...")
sys.stdout.flush()
foo()
sys.stdout.write("fatto!\n")
ciao
ksh