Friday, August 6, 2010

Python as a Research Tool

I love the Python programming language. It amazes me how when someone writes pseudo code to describe some algorithms, it tends to be a valid or almost valid Python code, even if the person who wrote it has no idea what Python is. Python is just the most natural way for humans to describe code.
Today I would like to discus the uses of Python as a research tool. I tend to believe that many different researches could benefit from this tool. I use Python for any kind of research I perform. Let’s take a look at my Python usage during the day:
First for any calculation I need to do, I use Python instead of calc.exe. This way I’ve got a log of all the operations I’ve been doing, I can play with the numbers in various ways, and see how everything changes if I just change a value in any of the steps of my calculation. I find the Python Reinteract interpreter, to be the best environment for the task. For those of you who are not familiar with Python Reinteract, it’s an interpreter in which you can go back to any executed line and change it, and see all the results reevaluated in cascade. A little bit like a Soviet encyclopedia, because it’s possible to rewrite the history.
This tool bring us to my college studies, in which I use Python to solve Linear Algebra and Calculus questions. The math modules that comes with Python and the Linear Algebra modules that comes with the Reinteract environment are perfect to solve, test, visualize, check guesses and gain better understanding of the studies.


 

But my true love is Idle-spoon, a simple variation of the well known idle-fork. The things that where added to the idle-fork in the idle-spoon version are better navigation, a Squeezer (shown in the pictures below) and enabling of more then one instance. When I preform research, the current status of the interrupter holds my current knowledge of the inspected target. I can access any piece of information, because it is all stored in global variables. This allows me to play with the data to try to make some sense of it.




The only thing I feel the lack of is a good debugger to work inside the Python interpreter.
I’m currently checking the PyScripter, to see if it is any good, for now I can just say that it looks like there are still some functions missing or incomplete.

Other than the variants above (all built upon cPython), I found that there are more variants, such as iPython which doesn’t have any GUI based environment, and therefore I find it to be just a bit less comfort to work with. I love vim, and I sometimes use gvim to write big scripts. I once read in a book that there is a good eclipse plugin for developing Python, but it has no instant interpreter, and therefore should not be considered for research. And for last and least, the Iron Python / Jython, which should both be considered blasphemy. The implementation of the Python VM inside of the Java VM or any other VM, is something that makes no sense to me. It usually suffers from the lack of many modules that I’m used to work with, if it works at all.

Links:
http://www.reinteract.org/trac/
http://idlespoon.python-hosting.com/
http://code.google.com/p/pyscripter/

Big thanks to the Fox for helping on the making of this blog post.

--- Update ---
The post is a bit outdated now. Idle-spoon became Dreampie, which is hardly supported anymore.

23 comments:

  1. great post!
    i didn't know reinteract and idlespoon. going to check them out!

    ReplyDelete
  2. Thanks Znavot.
    With great Python comes great responsibility.

    ReplyDelete
  3. amitm17/8/10

    If you liked idlespoon you will definitely like dreampie: http://dreampie.sourceforge.net/

    It's written by Noam Raphael, the guy who wrote the squeezer and completions components of idle. He got fed up with idle's architecture and decided to write his own interpreter.

    ReplyDelete
  4. Looks great, I shell give it a shot.

    ReplyDelete
  5. Shachar15/2/11

    Since you don't link to it anywhere, to the benefit of the general public - here are links to your research code (candy, mint, other stuff) on google code:
    http://code.google.com/p/pycandy/
    http://code.google.com/p/pymint/
    http://code.google.com/u/nativ.assaf/

    --Shachar

    ReplyDelete
    Replies
    1. Everything has moved to: https://github.com/assafnativ/NativDebugging

      Delete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. This comment has been removed by a blog administrator.

    ReplyDelete
  10. Good post. Keep sharing such kind of worthy information. Python Training in Chennai | Pega Training in Chennai

    ReplyDelete
  11. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops Training in pune

    Devops Training in Chennai

    Devops Training in Bangalore

    AWS Training in chennai

    AWS Training in bangalore

    ReplyDelete
  12. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    rpa training in Chennai | rpa training in pune

    rpa training in tambaram | rpa training in sholinganallur

    rpa training in Chennai | rpa training in velachery

    rpa online training | rpa training in bangalore

    ReplyDelete
  13. This is such a great post, and was thinking much the same myself. Another great update.
    python training in tambaram
    python training in annanagar
    python training in OMR

    ReplyDelete
  14. I am really impressed with your efforts and really pleased to visit this post.
    java training in chennai | java training in bangalore

    java online training | java training in pune

    ReplyDelete
  15. Amazing blog about the various informative information on the programming languages... Java Training in Chennai | Pega Training in Chennai

    ReplyDelete
  16. The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.
    Data Science course in kalyan nagar | Data Science course in OMR
    Data Science course in chennai | Data science course in velachery
    Data science online course | Data science course in jaya nagar

    ReplyDelete
  17. Very interesting blog which helps me to get the in depth knowledge about the technology, Thanks for sharing such a nice blog..
    Good discussion.
    Six Sigma Training in Abu Dhabi
    Six Sigma Training in Dammam
    Six Sigma Training in Riyadh

    ReplyDelete
  18. Interesting blog post. This blog shows that you have a great future as a content writer. Waiting for more updates... Pega Training in Chennai | Python Training in Chennai

    ReplyDelete
  19. Howdy, would you mind letting me know which web host you’re utilizing? I’ve loaded your blog in 3 completely different web browsers, and I must say this blog loads a lot quicker than most. Can you suggest a good internet hosting provider at a reasonable price?


    Best AWS Training Institute in BTM Layout Bangalore ,AWS Coursesin BTM


    Best AWS Training in Marathahalli | AWS Training in Marathahalli

    Amazon Web Services Training in Jaya Nagar | Best AWS Training in Jaya Nagar


    AWS Training in BTM Layout |Best AWS Training in BTM Layout

    AWS Training in Marathahalli | Best AWS Training in Marathahalli

    ReplyDelete
  20. Amazon has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web. Amazon Web Services (AWS) is a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow.For more information visit.
    aws online training
    aws training in hyderabad
    amazon web services(AWS) online training
    amazon web services(AWS) training online

    ReplyDelete