mapping function to vars
jahurt at hotmail.com
jahurt at hotmail.com
Thu Dec 9 12:09:16 EST 2004
More information about the Python-list mailing list
Thu Dec 9 12:09:16 EST 2004
- Previous message (by thread): Loading a file only once into an object and being able to access it from other modules - still have a problem
- Next message (by thread): mapping function to vars
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I need to map a function to several variables. I'm trying to use map and lambda to do this. Here's my attempt... #!/usr/bin/env python from random import * [fee, fye, foe, fum] = map(lambda n: random(), range(4)) print fee print fye print foe print fum ...I'm essentially trying to map a function that takes no parameters to a group of variables. This works, but pychecker complains about the 'n' parameter. Is there a better way to do this? TIA
- Previous message (by thread): Loading a file only once into an object and being able to access it from other modules - still have a problem
- Next message (by thread): mapping function to vars
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list