Tonight I spent a significant amount of time putting my boid density domain together into coherent python script. I figure since I'll be having some people working with me now, I shouldn't put them through the same pain I go through whenever trying to integrate my scripts with bigger things. With this new script, all you have to do is call the run_boids and it spits out the density that it got.
Also, I made a pretty bad ass python vector class. I basically wanted a tuple where tup1 + tup2 is the mathematical sum, not the concatenation. Honestly, this was the first time I have used inheritance in python and I must say I wasn't disappointing. Plus, I heavily overloaded operators to make the coding easier. I'm probably more excited about this than I should be. It really will make my coding easier, though.
Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts
Sunday, November 16, 2008
Sunday, October 26, 2008
Python Tutorial
I use the Python programming language for the majority of my coding tasks these days. Note the title of this blog.
In Dr. Tim Finin's Principles of Programming Languages course (CMSC 331), I will be giving a guest lecture tutorial on Python. Most of these students have a semester or two of Java and C experience from introductory computer science classes, so I tried to keep it relatively simple.
Since I have this tutorial written up I will hopefully keep it updated as I come across interesting things. Just a few days ago I learned about the back-ticks around something to convert to a string. E.g.,
Link: "Brief Introduction to Python"
In Dr. Tim Finin's Principles of Programming Languages course (CMSC 331), I will be giving a guest lecture tutorial on Python. Most of these students have a semester or two of Java and C experience from introductory computer science classes, so I tried to keep it relatively simple.
Since I have this tutorial written up I will hopefully keep it updated as I come across interesting things. Just a few days ago I learned about the back-ticks around something to convert to a string. E.g.,
`12345`[2] returns '3'. I saw this in one of my student's code for one of their coding assignments; I should read more code other than my own.Link: "Brief Introduction to Python"
Tags:
Python
Subscribe to:
Comments (Atom)