Friday, December 08, 2006

I'll admit that when I get new hardware or software I'm the kind that installs and just jumps in with both feet playing and experimenting. I've always thought that it is much better to get into the documentation with at least a basic grasp of what interfaces and such look like. At the same time though I am a huge proponent of structured progressive training. That is really where I'm headed right now with the following recommendations.

For anyone that is already programming in another language I think it is worthwhile to install Python on a computer even though it isn't strictly necessary for VrPython. I actually think it's a good idea for anyone, but if you just want to jump into VrPython, skip this for now you'll probably find other posts more helpful.

As of the time of this writing the current implementation of Python in Vr is 2.2. If that is what is installed then an extension called pywin32 which not only adds windows elements to Python, but also includes an editor and programming environment that I like much better than Idle.

Once you have the current Python that matches whatever is built into Vr, I recommend the following books. Skip any reference to gui programming and tkinter for now.
For basics start with.
"Sams Teach Yourself Python in 24 Hours"
The Quick Python Book"
For more advanced reference.
"Python Essential Reference"
"Python Cookbook"
I actually found all of them at my local library, though I like them so much I bought the last 3 to have around as a reference. I would read the first two at the same time or in that order. "Quick Python" was amazing in the information you can pick up fast if you have some programming experience. It is especially helpful for someone who might switch over to Python for routine programming. Pay special attention to the concept of lists, I think they are by far one of the coolest things available in Python, and will offer a lot of power as time goes by.

Why would a person want to switch to Python? Well for me it came down to the fact that I was spending time in it on a daily basis within VrOne anyway. Now with the introduction of the "pyedi" command, coding within Vr is even more convenient. However the more time I spend with it the more powerful and fast coding in this environment seems. I decided to try rewriting some basic file manipulation programs and found that the lines of code dropped to about %25 of the original once I switched from something like C++. The more I tried, the less restrictions I found, for example by adding libraries like PIL (Python Image Library) I was able to write a program that applies an external level file to an image. Sure I have that in ImageUtil, but I had mine a year earlier, and on every computer I own. So programming in general, and certainly Python, isn't for everyone, but it is a great place to start for beginners, and pure fun for those more experienced, in my opinion anyway.

No comments:

For anyone interested in trying VrPython for the first time or if you are early in the game, I suggest going to the earliest posts and working forward. I use VrPython every day for many wonderful things, needless to say it will change and could potentially damage a file. Any risk associated with using VrPython or any code or scripts mentioned here lies solely with the end user.

The "Personal VrPython page" in the link section will contain many code examples and an organized table of contents to this blog in a fairly un-attractive (for now) form.