The python program reports an error:
except Exception, ex:
^
SyntaxError: invalid syntax
As shown in the figure below:
Reason:
Because the python version I use is 3.7, except Exception, ex: This syntax needs to be run with python2 version
Solution:
except Exception, ex:
To
except Exception as ex:
After the compilation is normal, as shown in the following figure: