[Tutor] what does the warning indicate?
Hi!! I'm new to python and just trying to play around, when I run my program in the interactive shell before executing the program it shows the following warning : Warning: HOME environment variable points to H: but the path does not exist. RESTART >>> or sometimes it just gets stuck. What does this mean? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] the lambda func
Hi, I have just started learning python... Following is an example from dive into python: def info(object,spacing=10,collapse=1): """Print methods and doc strings. Takes module,class,list,dictionary or string.""" methodList=[method for method in dir(object) if callable(getattr(object,method))] processFunc=collapse and (lambda s: " ".join(s.split())) or (lambda s:s) print "\n".join(["%s %s" %(method.ljust(spacing),processFunc(str(getattr(object,method).__doc__))) for method in methodList]) if __name__=="__main__": print info.__doc__ now if i do the following: li=[] info(li) i get the expected output what i dont understand is the use of variable processFunc and i dont see the lambda function being called anywhere. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] need problems to solve
Hi, I was wondering where I could get problems in python for practicing. Thanks Regards Devayani ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] I cant find link
Hi I'm a begginner in python,tried the link pythonchallenge.com solved the first level, but i dont know how to go to the next one. Can somebody tell me how? Thanks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] I cant find link
On 7/14/06, Jason Massey <[EMAIL PROTECTED]> wrote: Devayani,What answer did you get? One of the things to rember on the challenge is to take your answer and put ".html" (no qutoes) on the end of it in the url.So for the first problem the url would be: http://www.pythonchallenge.com/pc/def/ .html On 7/14/06, Jason Massey < [EMAIL PROTECTED] > wrote: Devayani,What answer did you get? One of the things to rember on the challenge is to take your answer and put ".html" (no qutoes) on the end of it in the url.So for the first problem the url would be: http://www.pythonchallenge.com/pc/def/ .html On 7/14/06, Kent Johnson < [EMAIL PROTECTED]> wrote: devayani barve wrote:> Hi> I'm a begginner in python,tried the link pythonchallenge.com> <http://pythonchallenge.com/ > solved the first level, but i dont know> how to go to the next one.> Can somebody tell me how?In general the answer to one challenge becomes part of the URL for the next.Kent___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor Thanks to all Regarding the pythonchallenge.com, finally got the hang of it. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] python challenge 2
this is what i did for level 2 of python challenge: dict={'a':'c','b':'d','c':'e','d':'f','e':'g','f':'h','g':'i','h':'j','i':'k','j':'l','k':'m','l':'n','m':'o','n':'p','o':'q','p':'r','q':'s','r':'t','s':'u','t':'v','u':'w','v':'x','w':'y','x':'z','y':'a','z':'b','.':'.',"'":"'","(":"(",")":")"," ":" "} s="g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." f=file('book.txt','w')f.write(s)f.close()f=file('book.txt')k=[]while True: line=f.readline() if len(line)==0: break k=[line] list=[] for elem in k: for c in elem: temp=dict[c] print dict[c], And i got this: i h o p e y o u d i d n t t r a n s l a t e i t b y h a n d . t h a t s w h a t c o m p u t e r s a r e f o r . d o i n g i t i n b y h a n d i s i n e f f i c i e n t a n d t h a t ' s w h y t h i s t e x t i s s o l o n g . u s i n g s t r i n g . m a k e t r a n s ( ) i s r e c o m m e n d e d . n o w a p p l y o n t h e u r l . I pasted the above text in the url before .html and got permission denied!!! is my solution wrong? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] format string
Hi This is my program: import urllibans='y'while ans=='y': name=raw_input("Enter search:") name=name.replace(' ','+') name=name.replace('&','%26') go_url=" http://www.google.co.in/search?hl=en&q=%s" %name+"&meta=lr\%3Dlang_en" print go_url page = urllib.urlopen(go_url).read() ans=raw_input("do you want to continue?: ") It gives following error: Traceback (most recent call last): File "C:\python\urllib.py", line 1, in -toplevel- import urllib File "C:\python\urllib.py", line 9, in -toplevel- page = urllib.urlopen(go_url).read() AttributeError: 'module' object has no attribute 'urlopen' What does it mean? also I tried to assign go_url as go_url="http://www.google.co.in/search?hl=en&q=%s&meta=lr\%3Dlang_en" %name It takes the % in "%3D" as a part of format is there a way I can overcome this retaining the same manner of assinging? Thanks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] DOM using python
Hi all, I'm using python 2.3; I want to learn dom implementation in python right from the very basics do i need to install pyxml or anything else? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] xml dom
hi I wanted to know if there was any other source of learning dom implementation apart from python library reference? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] html processing
I have a table in hmtl and i want to write a program so that I can insert a column within it.. Can someone tell me what to use . as in dom??? Just want to know how to go about it!!! Thanks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor