Error running files developed with TextWrangler

A extensible, generic scripting IDE
Post Reply
hjenea
Posts: 2
Joined: Sat Sep 29, 2007 1:02 pm

Error running files developed with TextWrangler

Post by hjenea » Sat Sep 29, 2007 1:25 pm

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/ScrIDE.app/Contents/PlugIns/Python.plugin/Contents/Resources/ScrIDEBug.py", line 1038, in <module>
ScrIDEBugModule = compile(ScrIDEBugSource, ScrIDEBugSourceFile, "exec")
File "/Users/enea/Desktop/test.py", line 1
import wx

^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/Applications/ScrIDE_0.4 2/ScrIDE.app/Contents/PlugIns/Python.plugin/Contents/Resources/ScrIDEBug.py", 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

gandreas
Immortal
Posts: 1464
Joined: Wed Feb 04, 2004 6:02 pm
Contact:

Post by gandreas » Sat Sep 29, 2007 8:53 pm

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 file.py

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

hjenea
Posts: 2
Joined: Sat Sep 29, 2007 1:02 pm

Post by hjenea » Sun Sep 30, 2007 12:28 pm

Thanks for the reply. I did a hexdump as you suggested. The line endings were Cr. As you suggested UNIX line endings, Lf, work.

Horace

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest