Generate randon string

Asked by Sikulipro

How to generate random string in a text field letters ,numbers or symbols.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Eugene S (shragovich) said :
#1

Hi,

This is a pure Python question rather than Sikuli.
You can do something like that:

import random
import string

''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(N))

where N is the desired length of the string you want to generate.

Cheers,
Eugene

Can you help with this problem?

Provide an answer of your own, or ask Sikulipro for more information if necessary.

To post a message you must log in.