thelamecamel wrote:
> On Mar 4, 2:34 am, Jason Grout <[email protected]> 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.
You have 4 replace statements in there. Can you narrow down which is
causing a problem?
something like:
my_str = repr(res[i+1][1])
my_str = my_str.replace('{','[')
print my_str
my_str = my_str.replace('}',']')
print my_str
etc.
Jason
>
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---