Python - how to create a random string 8 bytes long?
Question: > **Possible Duplicate:**  
>  [python random string generation with upper case letters and
> digits](http://stackoverflow.com/questions/2257441/python-random-string-
> generation-with-upper-case-letters-and-digits)

I need to create a random string that is 8 bytes long in python.

    
    
    rand_string = ?
    

How do I do that?

Thanks


Answer: 
    import os
    rand_string = os.urandom(8)
    

Would create a random string that is 8 characters long.

