random number and word generate python code example

Example 1: word generator in python

from RandomWordGenerator import RandomWord

# Creating a random word object
rw = RandomWord(max_word_size,
                constant_word_size=True,
                include_digits=False,
                special_chars=r"@_!#$%^&*()<>?/\|}{~:",
                include_special_chars=False)

Example 2: word generator in python

from RandomWordGenerator import RandomWord

rw = RandomWord(max_word_size=5,
                constant_word_size=True,
                special_chars=r"@#$%.*",
                include_special_chars=True)

print(rw.generate())

Tags:

Misc Example