Using functions to reduce code.

Joshua Muskovitz josh at open.com
Tue Oct 17 14:02:46 EDT 2000


def myFunc(somelist, multiplier):
    for something in somelist:
        points = something.points
        for pt in points:
            pt.pt[1] = pt.pt[0]*multiplier
        something.points = points

myFunc(kiertopyora.curves, nopeuskiertopyora)
myFunc(ensio.curves, nopeusensio)
...

-- josh

Of course, you could choose better variable names in the function... :-)




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list