Python error in macro

Hi

I following the tutorial here

I have pasted this code

for myGlyph in Glyphs.font.glyphs:
	print( myGlyph.name, end=" " )
	print( myGlyph.category, end=" " )
	print( myGlyph.subCategory, end=" " )
	print( myGlyph.unicode )

but I get the error

  File "<string>", line 2
    print( myGlyph.name, end=" " )
                            ^
SyntaxError: invalid syntax

What version of Glyphs do you have?
The end argument is only available in python3 and Glyphs 2 still uses python2.
You can just put all in one line:

print(myGlyph.name, myGlyph.category, myGlyph.subCategory, myGlyph.unicode)

I think its because in Python 3, print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement. But if you write this in a program and someone using Python 2.x tries to run it, they will get an error. To avoid this, it is a good practice to import print function:

from __future__ import print_function

Now your code works on both python2 and python3