docs: python bindings howto
[gpgme.git] / lang / python / examples / howto / advanced / cython / keycount.pyx
1 import gpg
2
3 c = gpg.Context()
4 seckeys = c.keylist(pattern=None, secret=True)
5 pubkeys = c.keylist(pattern=None, secret=False)
6
7 seclist = list(seckeys)
8 secnum = len(seclist)
9
10 publist = list(pubkeys)
11 pubnum = len(publist)
12
13 print("""
14 Number of secret keys:  {0}
15 Number of public keys:  {1}
16 """.format(secnum, pubnum))