New to Typophile? Accounts are free, and easy to set up.
I have this small Python script that, for some reason, won't seem to terminate. The 2nd file that it's writing does not complete unless I click the "Reset macro system" button on the macro palette.
Any ideas?
Thanks,
Ken
BearLeft = fl.glyph.GetBoundingRect().x
BearRight = fl.glyph.width - fl.glyph.GetBoundingRect().ur.x
if BearLeft >= 0 and BearRight >= 0:
print "This glyph does not have a negative bearing."
else:
finame=str("C:\Program Files\FontLab\Studio5\Macros\Bearings Fix Old Left.txt")
TheFile = open(finame, "w")
TheFile.write(str(BearLeft))
TheFile.close
finame=str("C:\Program Files\FontLab\Studio5\Macros\Bearings Fix Old Right.txt")
TheFile = open(finame, "w")
TheFile.write(str(BearRight))
TheFile.close
17 Nov 2011 — 11:51pm
You have to write
(with parentheses) in order to execute the close method of the file object.
Eigi
19 Nov 2011 — 11:10am
Yep, that fixed it! Thanks yet again!
Ken