M
Marcello Pietrobon
Hello,
even if I learned something about Python,
still I don't know how to do ask the input from a user on the command line
This is my ( not working ) code:
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 )
Thank you for any answers,
Marcello
even if I learned something about Python,
still I don't know how to do ask the input from a user on the command line
This is my ( not working ) code:
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 )
Thank you for any answers,
Marcello