Re: Reading in external file - error checking and line numbers...

2005-09-07 Thread Hugh Macdonald
Thankyou! That was much easier than I expected. One more thing on a similar note. When raising exceptions, is it possible to remove a few items from the top of the stack trace? My stack trace is looking something like: File "ripple", line 160, in ? File "ripple", line 94, in executeR

Re: Reading in external file - error checking and line numbers...

2005-09-07 Thread Fredrik Lundh
Hugh Macdonald wrote: > I'm writing a tool at the moment that reads in an external file (which > can use any Python syntax) > > At the moment, I'm reading the file in using: > > scriptLines = open(baseRippleScript).read() > exec scriptLines > > However, if I raise an exception in my main code, in

Reading in external file - error checking and line numbers...

2005-09-07 Thread Hugh Macdonald
I'm writing a tool at the moment that reads in an external file (which can use any Python syntax) At the moment, I'm reading the file in using: scriptLines = open(baseRippleScript).read() exec scriptLines However, if I raise an exception in my main code, in a function that is cal