Mathematica-style notebook in Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick Muller

    Mathematica-style notebook in Python

    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?
  • Erik Lechak

    #2
    Re: Mathematica-style notebook in Python

    rick_muller@yah oo.com (Rick Muller) wrote in message news:<5eb8fb88. 0402121313.6a48 602b@posting.go ogle.com>...[color=blue]
    > 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?[/color]

    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
    prochak@netzero .net

    Comment

    • David E. Konerding DSD staff

      #3
      Re: Mathematica-style notebook in Python

      In article <1f0bdf30.04021 22327.13f7122f@ posting.google. com>, Erik Lechak wrote:[color=blue]
      > rick_muller@yah oo.com (Rick Muller) wrote in message news:<5eb8fb88. 0402121313.6a48 602b@posting.go ogle.com>...[color=green]
      >> 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?[/color][/color]

      You could use my "Py-ML" library which provides Mathematica support in Python.

      Free, secure and fast downloads from the largest Open Source applications and software directory - SourceForge.net


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

      Here's an example of using Py-ML:
      [color=blue][color=green][color=darkred]
      >>> function = MathematicaFunc tion("Plus",Mat hematicaInteger (1),[MathematicaSymb ol("x")])[/color][/color][/color]
      [color=blue][color=green][color=darkred]
      >>> print function[/color][/color][/color]
      Plus[1,x]
      [color=blue][color=green][color=darkred]
      >>> expression = MathematicaExpr ession(function )
      >>> e = m.evaluate(expr ession)
      >>> result= m.process()[/color][/color][/color]

      [color=blue][color=green][color=darkred]
      >>> Plus = MathematicaFunc tion("Plus")
      >>> function = Plus(1+"x")
      >>> print function[/color][/color][/color]
      Plus[1,x]
      or[color=blue][color=green][color=darkred]
      >>> x=MathematicaSy mbol("x")
      >>> function = 1+x
      >>> print function[/color][/color][/color]
      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

      Comment

      Working...