|
PANEL FOR YOUR BLOG & WEBSITE
|
|
|
You're on the right track with try/except, but pay careful attention to where the traceback says the exception was raised. I'm guessing it was actually theopen_regression_output_sheet = gc.open(file_name)line that raised the exception.
If that's the case, you need to wrap that line in a try/except like
try: open_regression_output_sheet = gc.open(file_name) except SpreadsheetNotFound: # handle the exception or whatever else: for value in open_regression_output_sheet: ...