def usr_rand(self,num_chars): if opt.usr_random: self.interactive() my_send(self.p,'\n') else: rand_chars = list(getrandstr(num_chars,no_space=True)) my_expect(self.p,'symbols left: ','x') try: vmsg_r('SEND ') while self.p.expect('left: ',0.1) == 0: ch = rand_chars.pop(0) msg_r(yellow(ch)+' ' if opt.verbose else '+') self.p.send(ch) except: vmsg('EOT') my_expect(self.p,'ENTER to continue: ','\n')