Skip to content

Variables Need to be Defined Global #3

@richardhemphill

Description

@richardhemphill

data = get_sample(stream,pa)

When I start running it, I get the following error and the animation stops with 1st image.

.../Live-Specgram/run_specgram.py", line 58, in update_fig
    data = get_sample(stream,pa)
NameError: name 'stream' is not defined

I was able to animate fine, after I declared variables global in the main definition.

def main():
    global stream
    global pa
    global im

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions