Im using pexpect to output some terminal commands, but im facing the following issue.
The code is
porttype = "Gi"
print
expectSw.sendline ("sh int counters errors | i %.*/1 ") % porttype
expectSw.expect ('.*#')
print expectSw.after
But when I run the code i get ...
Traceback (most recent call last):
File "./script", line 30, in <module>
expectSw.sendline ("sh int counters errors | i %.*/1 ") % porttype
TypeError: unsupported operand type(s) for %: 'int' and 'str'
It looks like it maybe trying to calculate the string. Can anyone shed any light onto this ?
Thanks,