• Home
  • Django
  • Check if variable is already defined

Check if variable is already defined

linkaiyi
Follow

Use try … except for NameError for catch the definition error

        try:
            wb2
        except NameError:
            wb2 = load_workbook(
                filename='C:\\Users\\KaiyiLin\\Documents\\Alex\\Boehringer\\check_relation\\SystemOrg_Template.xlsx',
                # profile 的文件地址, title和HC Code
                read_only=True)
Object has 0 attachments

Was this article helpful?

This article is viewed 14 times!

Recent Viewed Articles

Related Articles

0 Comments

Leave a Comment

Support