Page 1 of 1

Error running files developed with TextWrangler

Posted: Sat Sep 29, 2007 1:25 pm
by hjenea
I have a number of Python programs which I wrote using TextWrangler. When I try to run them using ScrIDE if the Debugger option on the Python menu is set to anything other than 'None', I get the following error msg.:

Traceback (most recent call last):
File "/Applications/ScrIDE_0.4 2/", line 1038, in <module>
ScrIDEBugModule = compile(ScrIDEBugSource, ScrIDEBugSourceFile, "exec")
File "/Users/enea/Desktop/", line 1
import wx

SyntaxError: invalid syntax
Traceback (most recent call last):
File "/Applications/ScrIDE_0.4 2/", line 1054, in <module>
print "*syntax,file=\"%s\",msg=\"%s\",line=\"%d\",offset=\"%d\"" % (sys.argv[1],ScrIDEBugException.msg, ScrIDEBugException.lineno, ScrIDEBugException.offset)
IndexError: list index out of range

The program in this case is just:

import wx

If I type this program using the ScrIDE editor it works with every debugger setting. When I save the ScrIDE file and use a 'file compare' program to compare it to my TextWrangler program, they are identical.

What's going on here?

By the way, is ScrIDE being supported, and is it a good idea to rely on it as my main Python IDE. On a feature by feature basis I think that it's the best IDE available on the Mac

Horace Enea

Posted: Sat Sep 29, 2007 8:53 pm
by gandreas
My guess is that one file has a "Mac OS" style line ending (hex 0x0d) instead of a "Unix" style line ending (hex 0x0a).

You can see this by, in the command line in a terminal window, with the following command:

hexdump -C

(where, of course, is the name of you file).

Posted: Sun Sep 30, 2007 12:28 pm
by hjenea
Thanks for the reply. I did a hexdump as you suggested. The line endings were Cr. As you suggested UNIX line endings, Lf, work.