Re: A question about unicode() function

2007-01-02 Thread JTree
hi, I just removed the unicode() method from my codes. As John Machin said, I had an wrong understanding of unicode and ascii. Paul Watson wrote: > JTree wrote: > > Thanks everyone! > > > > Sorry for my ambiguous question. > > I changed the codes and now it works fine. > > > > > > > > JTree wrote:

Re: A question about unicode() function

2007-01-02 Thread Paul Watson
JTree wrote: > Thanks everyone! > > Sorry for my ambiguous question. > I changed the codes and now it works fine. > > > > JTree wrote: >> Hi,all >> I encountered a problem when using unicode() function to fetch a >> webpage, I don't know why this happenned. >> My codes and error messa

Re: A question about unicode() function

2007-01-01 Thread JTree
Thanks everyone! Sorry for my ambiguous question. I changed the codes and now it works fine. JTree wrote: > Hi,all > I encountered a problem when using unicode() function to fetch a > webpage, I don't know why this happenned. > My codes and error messages are: > > > Code: > #!/usr/bin

Re: A question about unicode() function

2007-01-01 Thread John Machin
JTree wrote: > Hi, > > I changed my codes to: > > #!/usr/bin/python > #Filename: test.py > #Modified: 2007-01-01 > > import cPickle as p > import urllib > import htmllib > import re > import sys > > funUrlFetch = lambda url:urllib.urlopen(url).read() > > objUrl = raw_input('Enter the Url:') > cont

Re: A question about unicode() function

2006-12-31 Thread Tim Roberts
"JTree" <[EMAIL PROTECTED]> wrote: > >Hi,all > I encountered a problem when using unicode() function to fetch a >webpage, I don't know why this happenned. > My codes and error messages are: > > >Code: >#!/usr/bin/python >#Filename: test.py >#Modified: 2006-12-31 > >import cPickle as p >impo

Re: A question about unicode() function

2006-12-31 Thread JTree
Hi, I changed my codes to: #!/usr/bin/python #Filename: test.py #Modified: 2007-01-01 import cPickle as p import urllib import htmllib import re import sys funUrlFetch = lambda url:urllib.urlopen(url).read() objUrl = raw_input('Enter the Url:') content = funUrlFetch(objUrl) content = content.

Re: A question about unicode() function

2006-12-31 Thread Felipe Almeida Lessa
On 31 Dec 2006 05:20:10 -0800, JTree <[EMAIL PROTECTED]> wrote: > def funUrlFetch(url): > lambda url:urllib.urlopen(url).read() This function only creates a lambda function (that is not used or assigned anywhere), nothing more, nothing less. Thus, it returns None (sort of "void") no matter wha

A question about unicode() function

2006-12-31 Thread JTree
Hi,all I encountered a problem when using unicode() function to fetch a webpage, I don't know why this happenned. My codes and error messages are: Code: #!/usr/bin/python #Filename: test.py #Modified: 2006-12-31 import cPickle as p import urllib import htmllib import re import sys def