Hello everyone,
I am implementing a chatbot using Python, pyaiml and wxpython for gui.
I want to fetch urls using search engine(preferably Google) and display the fetched result in a textctrl widget. I saw some examples where the program gave url as result. I also read about urllib2 and am currently searching about it, but I’d like to know if there is any way to sort the fetched results and then display them? I don’t want to display any junk content or too lengthy urls. So maybe something like a hyperlink and on clicking it, the link opens in a browser?
Eg:
User:Search for Apples
Bot:Found 1 result. To view the search result, click here
Hence, what I would like to know is, is there any way to display urls like hyperlinks, inside the body of a textctrl object. Also, is there any way to set a default browser for opening the urls or it follows the default settings of OS?
I hope I didn’t mess and complicate the question 
Thanks in advance!
-Udgam
Is the textctrl really what you want?
Check out the wxPython demo and look at the different ListCtrl’s,
e.g. have some description on what you found in one column and the
URL in another or …
Opening URL’s with the default application can be done with the
‘desktop’ module:
There is also which might be of interest for
this.
Werner
···
Hi Udgam,
On 07/03/2014 12:23, Udgam Mehetre wrote:
Hello everyone,
I am implementing a chatbot using Python, pyaiml and
wxpython for gui.
I want to fetch urls using search engine(preferably Google)
and display the fetched result in a textctrl widget. I saw
some examples where the program gave url as result. I also
read about urllib2 and am currently searching about it, but
I’d like to know if there is any way to sort the fetched
results and then display them? I don’t want to display any
junk content or too lengthy urls. So maybe something like a
hyperlink and on clicking it, the link opens in a browser?
Eg:
User:Search for Apples
Bot:Found 1 result. To view the search result, click here
Hence, what I would like to know is, is there any way to
display urls like hyperlinks, inside the body of a textctrl
object. Also, is there any way to set a default browser for
opening the urls or it follows the default settings of OS?
I hope I didn’t mess and complicate the question 
Thanks in advance!
https://pypi.python.org/pypi/desktop
http://scrapy.org/
Is the textctrl really what you want?
Check out the wxPython demo and look at the different ListCtrl’s, e.g. have some description on >>what you found in one column and the URL in another or …
I was thinking about different options, but textctrl was first choice due to multiline feature. I guess I’ll try the Listctrl and check.
There is also http://scrapy.org/ which might be of interest for this.
Really grateful for this! Thanks a lot. Though it’s way over my skill-set to implement it, I’ll tinker around and try it out.
···
On 7 March 2014 17:07, Werner wernerfbd@gmx.ch wrote:
Hi Udgam,
On 07/03/2014 12:23, Udgam Mehetre wrote:
Hello everyone,
I am implementing a chatbot using Python, pyaiml and
wxpython for gui.
I want to fetch urls using search engine(preferably Google)
and display the fetched result in a textctrl widget. I saw
some examples where the program gave url as result. I also
read about urllib2 and am currently searching about it, but
I’d like to know if there is any way to sort the fetched
results and then display them? I don’t want to display any
junk content or too lengthy urls. So maybe something like a
hyperlink and on clicking it, the link opens in a browser?
Eg:
User:Search for Apples
Bot:Found 1 result. To view the search result, click here
Hence, what I would like to know is, is there any way to
display urls like hyperlinks, inside the body of a textctrl
object. Also, is there any way to set a default browser for
opening the urls or it follows the default settings of OS?
I hope I didn’t mess and complicate the question 
Thanks in advance!
Is the textctrl really what you want?
Check out the wxPython demo and look at the different ListCtrl's,
e.g. have some description on what you found in one column and the
URL in another or …
Opening URL's with the default application can be done with the
‘desktop’ module:
[https://pypi.python.org/pypi/desktop](https://pypi.python.org/pypi/desktop)
There is also [http://scrapy.org/](http://scrapy.org/) which might be of interest for
this.
Werner
–
You received this message because you are subscribed to a topic in the Google Groups “wxPython-users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/n4Ijy0IJwGQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
–
Udgam Mehetre
" *Imagination is the only weapon in the war against reality.*"