Skip to content

NameError in Chapter19/example3 #10

Description

@Matej-Chmel

When running script Chapter19/example3.py a NameError is raised:

scheduler.shutdown()
NameError: name 'scheduler' is not defined

The problem can be fixed by indenting the line 27 under the main guard.

Current version
if __name__ == '__main__':
    scheduler = BackgroundScheduler()
    ...
scheduler.shutdown()
Solution
if __name__ == '__main__':
    scheduler = BackgroundScheduler()
    ...
    scheduler.shutdown()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions