Saving meraki.dashboardAPI(API_KEY) in separate file.
I'm newbie to python would like some guidance.
I want to create a file with the meraki.dashboardAPI(API_KEY) in it and call it from scripts I write. I don't want to have the call in every script. I got the API_KEY in a file and call it into the script using from key import API_KEY and it works. I would like to create the same for the dashboardAPI call.
Re: Saving meraki.dashboardAPI(API_KEY) in separate file.
If you run two separate scripts, they won't share variables between them. Based on the text below, it appears that functions may be what you're actually looking for. You can pass values into them and return values from them.
They'll also describe how to load the API key into an environmental variable, which is a safer method to use than dropping it into a file. It prevents things like accidentally uploading your key to a GitHub repository.