Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
random string
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
def random_string(length):
str = ''
for i in range(length):
str += chr(random.randint(ord('#'),ord('~')))
return str
if __name__ == "__main__":
print random_string(16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.