Tag Archives: Python

Python Gotchas No. 2: Garbage Collection Oddities

Python is a garbage collected language. The garbage collector will collect orphaned objects. These are objects that have no references. If an object has a __del__ method, it will be called when that object is collected. Note however, that there … Continue reading

Posted in Programming, Python | Tagged , , , | 1 Comment

PyWeb-IL presentation: Advanced subjects in Python

Yesterday I gave a presentation at PyWeb-IL, which took place at Google’s offices in Tel-Aviv. The presentation went really well, and interested many people. Here are the slides for the presentation, “Advanced Python Subjects”.

Posted in Python, Teaching Programming | Tagged | Leave a comment

PythonTurtle delivers!

A few days ago, a coworker asked me what tool he should use to teach another non-programming coworker some programming. I thought a little, and suggested PythonTurtle, and then also demonstrated the builtin turtle. I thought nothing much of it, … Continue reading

Posted in Programming, Python, Teaching Programming | Tagged , , , | 1 Comment

Python Gotchas 1: __del__ is not the opposite of __init__

After discussing my last post with a friend and talking about a few other issues, we came to the conclusion that it would be worthwhile to discuss more gotchas. First though, what is a gotcha? Wikipedia gives a good definition: … Continue reading

Posted in gotchas, Programming, Python | Tagged , , | 6 Comments

GeneratorExit: another reason to upgrade to Python 2.6

Ever heard of GeneratorExit? Unless you write generators, and do some unusual stuff with them, you probably haven’t encountered it. GeneratorExit is a special exception that gets raised from within a generator when it is close()-ed. For example, consider the … Continue reading

Posted in Programming, Python | Tagged , , , , | Leave a comment

Preparing PyImprov for GeekCon on Friday

A long long time ago, I wrote Pytuner. It was one of the first projects I published on this website. For a long time it just sat there, doing nothing, while the library it’s based on – PyMedia, wasn’t being … Continue reading

Posted in Programming, Projects, Python, Sound | Tagged , , , | 3 Comments

10 Python Optimization Tips and Issues

Following my previous post on Optimizing Javascript, I thought I’d write a similar post regarding Python optimization.

Posted in computer science, Design, Optimization, Programming, Python | Tagged , , , , | 7 Comments

Checking the ulam spiral

In the following post, the Ulam spiral is described. It’s a very simple object – write down consecutive natural numbers starting from 41 in a square spiral. Curiously, the numbers on the diagonal are primes: Reading this post, I immediately … Continue reading

Posted in Math, Programming, Python | Tagged , , , , | 4 Comments

Fractals in 10 minutes No. 6: Turtle Snowflake

I didn’t write this one, but I found it’s simplicity and availability so compelling, I couldn’t just not write about it. In a reddit post from a while ago, some commenter named jfedor left the following comment: A little known … Continue reading

Posted in computer science, Fractals, Python | Tagged , , | 4 Comments

PyWeb-IL Presentation on Harvesting: Finding the Most Influential Artists

Yesterday I gave a presentation on harvesting to the PyWeb-IL group. In the presentation, I described what I learned about harvesting and also gave a concrete example of how to find the “most influential artists” using data from allmusic.com and … Continue reading

Posted in Python | Tagged , , , , | 1 Comment