[IPython-dev] IPython prompt delay

Fernando Perez Fernando.Perez at colorado.edu
Wed Nov 30 12:05:58 CST 2005


Frédéric Mantegazza wrote:
> Le Mardi 29 Novembre 2005 21:08, Fernando Perez a écrit :
> 
> 
>>The prompt system is fully dynamic, so the easiest way is to insert a
>>time.sleep() call into your prompt :)
> 
> 
> You mean like this :
> 
> argv = ["-pi1", "${time.sleep(0.2)}PyMAD>>> ",
>         "-po", " ",
>         "-profile", "pymad"]
> ipshell = IPShellEmbed(argv)
> 
> It works, but it displays 'None' before PyMAD. It is because time.sleep() 
> returns None, I presume. How can I make it return an empty string, 
> instead ?

Wrap it:

def mysleep(t):
   time.sleep(t)
   return ''

Cheers,

f




More information about the IPython-dev mailing list