I have a Python script that will simulate keyboard presses on my computer. The final function is of the form key(hexcode)
, where hexcode is the Hex Code of the key. I want to combine this with the "random" function, so I can type random strings in a program. For example, if I have the string
a = string.ascii_uppercase
and I want to write a random element of the string, all I need to do is write
print random.choice(a)
However, if I try to combine the type function with the random function, I get a whole lot of random errors. An example would be trying to type into Microsoft Word a random string of 6 capital letters. Any help is appreciated!