Open atlas-g0d opened 6 years ago
Hi,
Thanks for writing in! This looks like it need to be updated. The syntax should be except errors.DfpReportError as e:
Yeah, I tried that, too, but then got an indent error.
File "dfp_api_savedquery.py", line 40
except errors.DfpReportError as e:
^
IndentationError: unexpected unindent
The indent seems right to me (with my 1-2 yrs python experience) so still trying to figure it out.
Thanks, @grivescorbett !
Weird, feel free to post to the DFP API Forum and we can give you a hand with the implementation over there.
I got the code to work by doing the following:
except errors.DfpReportError, e:
to except errors.DfpReportError
as
e:
except errors.DfpReportError as e:
stays under Try
on line 54. Atom editor auto-adjusted the indention incorrectly so I had to move it back.Print 'string'
needs to be changed to Print('string')
.WithBindVariable('id', long(saved_query_id))
to .WithBindVariable('id', int(saved_query_id))
Whala- everything ran after that. I know it has to do with the Python version (2 vs 3) but I am not familiar with how to work around the version changes. I'm sure there's some lib for that. I guess I'll figure that out eventually. Hope this helps!
I get the following syntax error on line 39 of run_saved_query.py:
Here's the snipet from code (starting on line 36) that I can't figure out how to format:
Is this a python version issue?
Thanks for the help!