[sage-support] Re: Interface to mathematica

2009-08-15 Thread thelamecamel
like > > > > > sage_stuff = sage_eval(expr, locals = {'dx' = 'dx'}) > > > > It's {'dx':'dx'} or something like that.  Definitely not 'dx' = 'dx'. > > > > > where expr is your mathematica expres

[sage-support] Re: Interface to mathematica

2009-08-13 Thread thelamecamel
Hi Viny, Sage's mathematica support at present seems to be geared towards sending data to mathematica and printing the results to the screen, rather than getting mathematica's results back into sage for data manipulation. So the going may be a little rough. Sage can convert its own arrays into

[sage-support] Re: Importing lists from mathematica

2009-03-04 Thread thelamecamel
On Mar 5, 4:40 pm, Jason Grout wrote: > thelamecamel wrote: > > 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 th

[sage-support] Re: Importing lists from mathematica

2009-03-04 Thread thelamecamel
On Mar 4, 2:34 am, Jason Grout 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 happe

[sage-support] Re: Importing lists from mathematica

2009-03-02 Thread thelamecamel
On Mar 3, 4:46 am, Jason Grout wrote: > You are missing a closing bracket and comma at the end of this line > (i.e., "],"). The number looks a little smaller as well. Was something > chopped off? > > Jason Oh man, that's what's happening. When I print another failing string from mathematica,

[sage-support] Re: Importing lists from mathematica

2009-03-01 Thread thelamecamel
Hi guys, For the benefit of others stuck as I was, or for those working on the ticket, here's a simplified version of what's been working for me over the last few months: res = mathematica(mathcommand) res_s = repr(res).replace('{','[').replace('}',']').replace ('*^','e').replace('\n','') #Conve

[sage-support] Re: Importing lists from mathematica

2009-01-06 Thread thelamecamel
Thanks all for speedy help! On Jan 7, 4:25 pm, Jason Grout wrote: > These are not the right way to do this, but they seem to give results > for right now, at least until someone fixes this: > > sage: a=mathematica([1,2,3]) > sage: [a[i] for i in range(1,a.Length()+1)] > [1, 2, 3] > > Or > > sage

[sage-support] Importing lists from mathematica

2009-01-06 Thread thelamecamel
Hi, I have inherited a numerical simulation program a few thousand lines long, written in Mathematica (and fortran via mathlink) into Sage. I am fed up with Mathematica as a programming language and would like to replace this with python code, to be run in sage. As an intermediate stage I was h