I have written a small test script:
#!/usr/bin/env python
import pexpect
import re
List_dictionary = {
'b -c \\"select name,type,is_supported from algorithm where name = \\\'RSA\\\' and key_size=1024 \\"':'app \"algo -e -n RSA -ks 1024\"',
'b -c \\"select name,type,is_supported from algorithm where name = \\\'RSA\\\' and key_size=1024 \\"':'app \"algo -d -n RSA -ks 1024\"'
}
test_dict={
'a':1,
'b':2
}
for a,b in List_dictionary.items():
print a
for a,b in test_dict.items():
print a
print len(List_dictionary)
print len(test_dict)
The output I am getting is:
./test.py
b -c \"select name,type,is_supported from algorithm where name = \'RSA\' and key_size=1024 \"
a
b
1
2
Why is only one element fetched from List_dictionary and the length of it is 1. Instead as per my knowledge it should be 2.