On Mar 4, 2:34 am, Jason Grout <jason-s...@creativetrax.com> wrote:
> My guess is it is a problem with the pexpect interface with Mathematica.

I no longer think it's a problem with the interface to mathematica - I
can print the output from mathematica before and after doing the
replace()s, and the corruption definitely happens between the two
print statements.

If you have the time, run a slightly different version of the loop
(again using the file at http://www.physics.usyd.edu.au/~felix/sage/res.m
):

mathematica('SetDirectory["/path/to/file/"]')
mathematica("<< res.m")
res = mathematica('res')
for i in range(84):
    print repr(res[i+1][1])
    resel_s = repr(res[i+1][1]).replace('{','[').replace
('}',']').replace('*^','e').replace('\n',' ')
    print resel_s + '\n'
    resel = sage_eval(resel_s)

When it crashes, check out the last two print statements - resel_s
will be corrupt, with a comma and part of a number missing, while repr
(res[i+1][1]) will not be.  This is strange behaviour.

Cheers,
Felix
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to