Python random file [Was] Re: [PD] [PD-announce] more objects from libc: stat - get file info

chris clepper cgc at humboldtblvd.com
Wed Jun 14 20:48:21 CEST 2006


On 6/14/06, Tim Blechmann <TimBlechmann at gmx.net> wrote:
>
> would this python one-liner be an option for you?
>
> import random, glob
>
> def choose(path):
>     return random.choice(glob.glob(path+"/*.mov"))


I hard coded the path  so it looks like this:

import random, glob

def randy():
    return random.choice(glob.glob("E:/pd_merge/past/*.mov"))

The only problem is the output from the py object is

print: symbol E:/pd_merge/past\\\\5.4.2006.9.49.4.mov

What's up with the extra \\\\ ?  Getting this working could solve a huge
headache on Windows.

Thanks
cgc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060614/71543ea4/attachment.htm>


More information about the Pd-list mailing list