一个函数中的多个try/except不能

2024-03-29 12:14:08 发布

您现在位置:Python中文网/ 问答频道 /正文

 def creating_folder_for_csv_files(cwd):
     try:
         os.makedirs(cwd+'\\migration_data\\trade')
     except os.error, e:
         print "Could not create the destination folder for CSV files"
    # end of first try/except block

     try:
         os.makedirs(cwd+'\\migration_data\\voucher')
     except os.error, e:
         print "Could not create the destination folder for CSV files"

在我的代码中,第一个try/except块起作用,但第二个不起作用。怎么了?在


Tags: fordataoscreatenoterrorfilesfolder