raw_input

Robert Brewer fumanchu at amor.org
Mon Apr 19 22:17:04 EDT 2004


Marcello Pietrobon wrote:
>         if ( not os.path.exists( dirname) ):
>             msg = 'The directory \'%s\' does not exist. 
> Create it [y/n] 
> ?' % dirname
>             c = raw_input( msg ).lower
>             if ( c == 'y' or c == 'yes' ):
>                 os.makedirs( dirname)
>             else:
>                 raise Exception( 'directory \'%s\' not created, 
> impossible to continue !' % dirname )

try lower() instead of lower.


FuManChu




More information about the Python-list mailing list