By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

Mathematica-style notebook in Python

P: n/a
I was wondering whether anyone has considered writing a
Mathematica-style notebook in Python. I use Python to do a lot of
scientific analysis, and I really like it's power. But what I always
envy about my friends who use Mathematica is the notebooks they
generate, which contain plots, annotations, and other information, in
a format that can be reloaded easily when you want to check your work.

Before I start doing something like this, has anyone else considered
it?
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ri*********@yahoo.com (Rick Muller) wrote in message news:<5e**************************@posting.google. com>...
I was wondering whether anyone has considered writing a
Mathematica-style notebook in Python. I use Python to do a lot of
scientific analysis, and I really like it's power. But what I always
envy about my friends who use Mathematica is the notebooks they
generate, which contain plots, annotations, and other information, in
a format that can be reloaded easily when you want to check your work.

Before I start doing something like this, has anyone else considered
it?


I have been working the last several months on just that issue. It is
a library that contains interactive plotting, block diagram, imaging,
and text rendering capabilities. It is written in 100% python. It
currently can use either wxWindows or pygame to display its diagrams
(I am working on TK now ... others to come). The nice thing about it
is no matter what underlying GUI library you use to display the
diagram it always looks the same.

I am about ready to release the second version of the library (its
called Pyxel). BTW its opensource - free for commercial and
opensource use.

I can send anyone the code that wants to preview it before the
release. Just drop me a line. I could use some help on the plotting
aspect, if anyone is interested.

Thanks,
Erik Lechak
pr*****@netzero.net
Jul 18 '05 #2

P: n/a
In article <1f**************************@posting.google.com >, Erik Lechak wrote:
ri*********@yahoo.com (Rick Muller) wrote in message news:<5e**************************@posting.google. com>...
I was wondering whether anyone has considered writing a
Mathematica-style notebook in Python. I use Python to do a lot of
scientific analysis, and I really like it's power. But what I always
envy about my friends who use Mathematica is the notebooks they
generate, which contain plots, annotations, and other information, in
a format that can be reloaded easily when you want to check your work.

Before I start doing something like this, has anyone else considered
it?
You could use my "Py-ML" library which provides Mathematica support in Python.

http://py-ml.sourceforge.net/

You should (in theory- I never tried it) be able to create notebooks programmatically
and control them from Python.

Here's an example of using Py-ML:
function = MathematicaFunction("Plus",MathematicaInteger(1),[MathematicaSymbol("x")]) print function Plus[1,x]
expression = MathematicaExpression(function)
e = m.evaluate(expression)
result= m.process()
Plus = MathematicaFunction("Plus")
function = Plus(1+"x")
print function Plus[1,x]
or x=MathematicaSymbol("x")
function = 1+x
print function

Plus[1,x]
More complicated functions, such as integrals, are entered easily.
The integral of x^2 with x varying from 0 to 2:
function = Integrate(Power("x",2), List("x",0,2))

.... unfortunately, I don't really use Mathematica any more (it's just too expensive and it never simplified
any interesting integrals for me), so Py-ML isn't really an active software project any more.
There are a lot of interesting opportunities for further development.

Dave
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.