interactive-tutorials icon indicating copy to clipboard operation
interactive-tutorials copied to clipboard

Invalid syntax error in main.py

Open FabC opened this issue 8 years ago • 2 comments

I cloned interactive-tutorials locally and installed Flask with the intention to verify my contributes. When I start Flask with

FLASK_APP="main.py -d learnpython.org" flask run

I got the error

File "/home/fabrizio/interactive-tutorials/main.py", line 152 except Exception, e:

I'm using Python 3.5.2

FabC avatar Nov 11 '18 12:11 FabC

I have the same error using Python 3. Solution:

  1. Install python2-flask
  2. Run "python2 main.py -d learnpython.org"

CDEguia avatar Apr 23 '19 14:04 CDEguia

C:\Users\sharanJs\interactive-tutorials>py -2 main.py -d learnpython.org Traceback (most recent call last): File "main.py", line 225, in <module> init_tutorials() File "main.py", line 190, in init_tutorials tutorial_dict["page_title"] = tutorial.decode("utf8") File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecode Error: 'utf8' codec can't decode byte 0xe0 in position 9: invalid continuation byte

I'm getting this error in python2.7.17, what's the fix?

shrn01 avatar Mar 23 '20 13:03 shrn01