Python Forum
global name 'completion_name_regex' is not defined
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
global name 'completion_name_regex' is not defined
#2
(Feb-21-2018, 04:36 PM)tjnichols Wrote:
Error:
NameError: global name 'completion_name_regex' is not defined

The error is very descriptive. You're trying to use a variable that doesn't exist.
Here's your code, with the string removed. Hopefully you see the issue :)
        completion_regex = "" 
        completion_pattern = re.compile(completion_name_regex) 
Unrelated, but for your sanity, you should avoid having spaces in your file names. As is, how would you import your file into a different script?
Reply


Messages In This Thread
RE: global name 'completion_name_regex' is not defined - by nilamo - Feb-21-2018, 04:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020