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 assembly debugger to work inside the Python interpreter. As for PDB, I see no use for it due to the GDB syndrome it shows. GDB is a command line debugger that can make a good platform for writing debugging tools. But using the GDB directly is something that tends to be quite slow, ineffective, and limiting of expressiveness.
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.

38 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. I have read your blog its very attractive and impressive. I like it your blog.


    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai Java Training in Chennai

    Java 8 online training Java 8 online training Java Online Training Java Online Training JavaEE Training in Chennai JavaEE Training in Chennai

    ReplyDelete
  7. The blog gave me idea about python Thanks for sharing it
    Python Training in Chennai

    ReplyDelete
  8. Do you want to share it?

    ReplyDelete
  9. I have read your blog its very attractive and impressive. I like it your blog. Java Training in Chennai

    ReplyDelete
  10. Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!! Java Training in Chennai

    ReplyDelete
  11. This gave good idea for all the python learners. Thanks for sharing..,


    Python Training in chennai

    ReplyDelete
  12. Great post! I am see the great contents and step by step read really nice information.I am gather this concepts and more information. It's helpful for me my friend. Also great blog here with all of the valuable information you have.
    Python Training in Chennai

    ReplyDelete
  13. Great post.., you provide a great information that will help me to improve my knowledge.Thanks for sharing.Keep sharing more blogs..


    Python Online Training

    ReplyDelete
  14. Great post. Thanks that you have able to give us a lot of great ideas and concepts on how to properly use the Python research tool in our study. This really gives a lot of great perspectives in our learning.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Awesome post.
    I read your blog everything is helpful and effective.
    Thanks for sharing with us.
    Python Training in Chennai

    ReplyDelete
  17. I have read all the articles in your blog; was really impressed after reading it. Besant Technologies is glad
    To inform you that; we provide practical training on all the technologies with MNC exports. We
    Assure you that through our training the students will gain all the sufficient knowledge to have a voyage in IT industry. Selenium Training in Bangalore |
    Python Training in Bangalore |

    ReplyDelete
  18. Nice Information as python research tool my sincere thanks for sharing this post Please Continue to share this post
    Python Training in BTM Layout

    ReplyDelete
  19. Great articles, first of all Thanks for writing such lovely Post! Earlier I thought that posts are the only most important thing on any blog... Java Training in Marathahalli
    Python Training in Marathahalli

    ReplyDelete
  20. Thanks for sharing such a useful information. I am very happy to read your post. It is really very helpful for us and I have gathered some important information from this blog. Java Training in Chennai | Software Testing Training in Chennai

    ReplyDelete
  21. thank you for sharing....now this is the time to lead your life then learn Java Training in Marathahalli get a IT JOB easily. More details
    Data Science Training in BTM Layout

    ReplyDelete
  22. Hello Admin,
    I really enjoyed while reading your article, the information you have mentioned in this post was damn good. Keep sharing your blog with updated and useful information.
    Regards,
    Python Training in Chennai

    ReplyDelete
  23. Really very nice article... Python is an interpreted, interactive, high level programming language similar to PERL, having great scope in the current situation. Wish learn python programming, enroll you in Login to learn more...
    Python Training in Velachery|Best Python Training in Velachery

    ReplyDelete
  24. It has been just unfathomably liberal with you to give straightforwardly what precisely numerous people would've promoted for an eBook to wind up making some money for their end, basically given that you could have attempted it in the occasion you needed.

    python training in bangalore|

    ReplyDelete
  25. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    Java Training in Bangalore

    ReplyDelete
  26. Thanks a lot very much for the high your blog post quality and results-oriented help. I won’t think twice to endorse to anybody who wants and needs support about this area.
    Besant technologies Marathahalli

    ReplyDelete
  27. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    hadoop training in chennai

    ReplyDelete
  28. Nice to read your article! I am looking forward to sharing your adventures and experiences.
    training courses

    ReplyDelete