File tree 1 file changed +16
-13
lines changed
1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -24,31 +24,34 @@ Usage
24
24
>>> import duckduckgo
25
25
>>> r = duckduckgo.query(' DuckDuckGo' )
26
26
>>> r.type
27
- 'answer'
27
+ u 'answer'
28
28
>>> r.results[0 ].text
29
- 'Official site'
29
+ u 'Official site'
30
30
>>> r.results[0 ].url
31
- 'http://duckduckgo.com/'
31
+ u 'http://duckduckgo.com/'
32
32
>>> r.abstract.url
33
- 'http://en.wikipedia.org/wiki/Duck_Duck_Go'
33
+ u 'http://en.wikipedia.org/wiki/Duck_Duck_Go'
34
34
>>> r.abstract.source
35
- 'Wikipedia'
35
+ u 'Wikipedia'
36
36
37
37
>>> r = duckduckgo.query(' Python' )
38
38
>>> r.type
39
- 'disambiguation'
40
- >>> r.related[6 ].text
41
- 'Python (programming language), a computer programming language'
42
- >>> r.related[6 ].url
43
- 'http://duckduckgo.com/Python_(programming_language)'
39
+ u'disambiguation'
40
+ >>> r.related[1 ].text
41
+ u'Python (programming language), a computer programming language'
42
+ >>> r.related[1 ].url
43
+ u'http://duckduckgo.com/Python_(programming_language)'
44
+ >>> r.related[7 ].topics[0 ].text # weird, but this is how the DDG API is currently organized
45
+ u'Armstrong Siddeley Python, an early turboprop engine'
46
+
44
47
45
48
>>> r = duckduckgo.query(' 1 + 1' )
46
49
>>> r.type
47
- 'nothing'
50
+ u 'nothing'
48
51
>>> r.answer.text
49
- '1 + 1 = 2'
52
+ u '1 + 1 = 2'
50
53
>>> r.answer.type
51
- 'calc'
54
+ u 'calc'
52
55
53
56
>>> print duckduckgo.query(' 19301' , kad = ' es_ES' ).answer.text
54
57
19301 es un código postal de Paoli, PA
You can’t perform that action at this time.
0 commit comments