Python Forum

Full Version: Script I can't figure out how to use
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was trying to run this script:
https://languagefixation.files.wordpress...tml-py.pdf
which I need to convert the output of a text-alignment software from txt to html in order to make it more readable. Having no previous experience with python, or coding in general, I simply downloaded Python 3.6, opened IDLE and pasted the code from the pdf file, after which I tried to manually reproduce all the indents. However, when I tried to run it, I got "invalid syntax", with the comma in the following line:

raise ValueError, "Unexpected line format\n%s" % hunline

highlighted in red.

I would be very grateful if somebody could help me out with this as I really haven't got the faintest idea what I am doing, or am supposed to do.

thanks
That code is written for an older version of Python. You need Python 2.7, and you need to run it in that version.
Thanks!