Python Related
Other Languages
Just Useful Tools
I got tired of coming back to the Yahoo page just to check on stock quotes. This is a small program that gathers and updates stock quotes from Yahoo Finance. It utilizes HTTP to obtain the quotes so will work through corporate firewalls.
Installation instructions:
Limitations:
This quick idea got flushed out from my habit of coming back again-and-again to the python module library and flipping through its pages to figure out the methods that a module supports. The code-completion feature of modern IDEs is convenient, but all the scrolling that one has to do grew somewhat tiring. Ok, this is what it looks like:
You just type in the module name and all its supported methods get displayed via the dir() function. It only displays the top-most level hierarchy of the module. However, many times it is good enough; and the purpose here is to present a cheat sheet of the module.
This quickie tool requires wxPython. You need this installed to run it. Much of the code is generated from using Boa Constructor. It makes use of Python's dynamic import mechanism. You can download the 2 source files that are zipped here. Execute from the command-line by running App1.py.
First of all, Tyranny of Choice is a condition of American society that psychologist Barry Schwartz has been trying to make the us aware of. It basically says that having some choices in our decision making process is good, but having too many choices cripples us. Having many choices, we are immensely pressured to not make a wrong choice. (who in their right mind wants to be the idiot making a wrong decision?) The process of making the right choice takes up so much of our time, effort, and causes a great amount of frustration. Multiply this by the number of things we have to make decisions on: what kind of pancakes for breakfast, what kind of coffee at Starbucks, what kind of dressing on the salad.... and the list goes on-and-on within the routine that is our everyday lives. It is a wonder we can ever get through our day at all.
In terms of developing computer programs with Python, there is a great benefit in that it include a large set of batteries/library to leverage your program off of. In addition, there is a plethora of 3rd party libraries that we could leverage from. This can be seen as a boon.
However, I am noticing the Tyranny effect happening. My previous difficulty in choosing a networking library is one instance. If you do GUI programming, your array of choices are: TK, wxPython, PythonCard, BOA, QT, EasyDialogs, Wax, .... and the list goes on. Someone else can probably make a list of the array of choices available for web-frameworks or even Templating.
I am going to say that this is just a general observation so that it won't invoke backlash from proponents of Python. I don't want to start a word war just because of an observation. But the pattern is there. Even the Effbot noticed: we really don't need eight ways to open the trunk.
3-17-06 . Addendum: There was a jot previously of the opposite effect in - Monopolies and software resuse. Contrary to popular thought, this is where monopolies might just be good for you.
It has been 3 years since I have done any programming with wxPython. In order to refresh myself, I bring out an old project and try to execute it. It crashes with various Exceptions and as I fix each one, another just takes its place. In this instance, it was that wxPython was changing its interfaces fairly recently.
Let's just ignore the specifics and just notice the general behavior that python projects just seem to break over time. As much as I enjoy working with Python, again-and-again this scenario arises. Some source code even stopped working when a new Python distribution is released. Have other people experienced the same? If you have, what do you do about it? The realization of hearty efforts put into development can easily go down the drain in the pretty near future disturbs me.
Python apparently has slowly increased its momentum over the past few years. I am not sure how well it is accepted in corporations. Is it acceptable to mention it more than casually above a whisper? There are more books about it in the bookstores. Here are some of the big names in Python that are now working for Google: Alex Martelli & Guido van Rossum. Are there anymore that I don't know of?
These are some of the more interesting links recently:
I am expecting to do lots of socket programming to implement some new protocols in the near future. Having seen the ugliness of the C++ code, I have chosen to use the Python batteries (i.e. socket and thread classes built into the python library) to lessen the amount of code that would have to be written. After a couple of days at it, the code is flowing decently.
Today, I am perusing an O'Reilly book at Barnes and Noble about the Twisted Framework. I have looked at Twisted before but never really paid close attention. After perusing the book, I still have that question on my mind: What does Twisted give us that we can't already get from the python library? FTP, sockets, threading, NNTP, POP3, etc....every protocol that Twisted provides seem to be available as some class already existing in the library. The example programs given (written against the framework), were about the same length as when written with the Python Libraries.
Again, why Twisted?