.
Pingback: Saturday snippet – Tuple assignment | eX-SI
With all due respect, you are going a very convoluted route with all this. You can do:
def get_random_percentage(iterable, percentage):
amount = int( float(len(iterable)) * (percentage/100.0) )
return random.sample(iterable, amount)
randomXSISelectionsExample.py
hosted with ❤ by GitHub
Yes, now that I look at it, my literal conversion of that Maxscript isn’t pretty. I remember I was more focused on figuring out what that Maxscript actually did.
No offense, but “with all due respect” always makes me think something like this 😉
haha, well I didn’t really mean it that way. 😉 keep up the great blog! I read it every week.