Isqua Istari

The Wise Wizards

Python

Posted in Other by Ziggy Tuesday February 27, 2007 at 16:48

Okay Okay Okay
I’m learning Python scripting language. It’s been great so far, very fun to be learning code again. Anyhow, today I got to the “Input and Output” section, where you learn how to deal with files and such. Well, I’m playing around with a file, and I decide I want to write a period between each character in the file, so here’s what I do:

for i in tmp:
tmp.seek(1,1)
tmp.write(‘.’)

You guessed it! The hard drive starts to spin…
and spin…
and spin…
and spin…
and spin…
and spin…

So I busted out the task manager and killed the process. When it was all over, I was left with a 91.348 megabyte text file filled with periods… so cool.

The best part is… The text of this post is copied directly from a Python generated file.


3 Comments »

  1. Python is a very peculiar, yet cool language. I would like to learn it eventually, as well.

    Sounds like you are having a lot of fun with it. 🙂

    Said by Dan 2/28/2007 at about 02:24

  2. I may have written a lousy C program to calculate the odds of rolling certain numbers of a variety of kinds of dice that wound up filling up memory, the page file, and crashing Windows, but I don’t think I’ve ever intentionally started filling up my hard drive with periods. 😉

    Glad to hear you’re having fun!

    Said by Toad 2/28/2007 at about 18:33

  3. Okay, I admit it, I am a code junkie. I love learning new codes. I never would have guess it a year ago.

    ::Waves::

    Hi ziggy

    Said by sunny 3/25/2007 at about 14:07

Leave a comment


RSS feed for comments on this post. TrackBack URI

Powered by Wordpress, theme by neuro