random function with strings

Peter Hansen peter at engcorp.com
Sat Jun 21 23:16:25 EDT 2003


ataraxia2500 wrote:
> 
> I have a function that goes through a directory and I would like to remove
> randomly one of the files contained in that directory. I checked out the
> random() function in the documentation but it only deals with integers.

Use random.choice() instead.




More information about the Python-list mailing list