Skip to content

Commit

Permalink
Merge pull request #116 from noraj/patch-2
Browse files Browse the repository at this point in the history
py 2 to 3
  • Loading branch information
achillean authored Jan 31, 2020
2 parents 7456ca6 + a3084d3 commit 4bdcd68
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/examples/query-summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ and country.
# Input validation
if len(sys.argv) == 1:
print 'Usage: %s <search query>' % sys.argv[0]
print('Usage: %s <search query>' % sys.argv[0])
sys.exit(1)
try:
Expand All @@ -62,22 +62,22 @@ and country.
# And it also runs faster than doing a search().
result = api.count(query, facets=FACETS)
print 'Shodan Summary Information'
print 'Query: %s' % query
print 'Total Results: %s\n' % result['total']
print('Shodan Summary Information')
print('Query: %s' % query)
print('Total Results: %s\n' % result['total'])
# Print the summary info from the facets
for facet in result['facets']:
print FACET_TITLES[facet]
print(FACET_TITLES[facet])
for term in result['facets'][facet]:
print '%s: %s' % (term['value'], term['count'])
print('%s: %s' % (term['value'], term['count']))
# Print an empty line between summary info
print ''
print('')
except Exception, e:
print 'Error: %s' % e
except Exception as e:
print('Error: %s' % e)
sys.exit(1)
"""
Expand Down

0 comments on commit 4bdcd68

Please sign in to comment.