Re: [Tutor] Subclassing vs. stand alone functions

2007-06-15 Thread Senthil_OR
[EMAIL PROTECTED] wrote: > > Let's say you want to load a dictionary. Do I create a function that > accepts some argument (say a file name) and returns a dictionary, or > do I subclass dict and override the __init__ and __setitem__ > functions to make 'self-loading' dictionary? It seems the end r

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Senthil_OR
Okay, I guess, people are missing points here. When do you #!/usr/local/bin/python You are specifying the location to the python executable in your machine, that rest of the script needs to be interpreted with. You are pointing to python is located at /usr/local/bin/python Consider the poss

Re: [Tutor] urlencode

2007-06-05 Thread Senthil_OR
>From: Lee Jones >Subject: [Tutor] urlencode >Hello, >I am trying to urlencode a string. In python the only thing I can see is the urllib.urlencode(). But this takes a dictionary, and returns >"key=value", which is not what I want. I only want to url-encode a string. Does any one know how to d

Re: [Tutor] Adding a (Python) Command Button in Maya

2007-05-14 Thread Senthil_OR
From: Preecha Bundrikwong Sent: Monday, May 14, 2007 3:24 PM To: tutor@python.org Subject: [Tutor] Adding a (Python) Command Button in Maya I'm pretty new to Python. I want to add a command button in Maya. Once clicked, it runs Python's script/program. I'm not sure where I should write to ask P

Re: [Tutor] ActivePython and CPython

2007-05-14 Thread Senthil_OR
What are the difference between ActiveState's Python distributions and the standard Python distribution from python.org , and which is better? Answer: Python from python.org is Open Source Software developed under OSI compatible license. Bunch of Python Developers are w

Re: [Tutor] a very simple question

2007-03-23 Thread Senthil_OR
Carson Wendy wrote: > ok, i just started python and i'm stuck on this, could use some help > :D > a='test' > def f(): > a=a+'gg' Look for the definition of 'global' And try this: >>> a = 'test' >>> def f() global a a = a + 'gg' print a >>>f() -- Senthil Dish of

Re: [Tutor] Best IDE for Python

2007-01-25 Thread Senthil_OR
Dick Moores wrote: >> Hi, >> I am using vim editor to code my project in python.Is there a good >> IDE where in I type the name of the class object and then dot then >> all the attributes of the object are displayed so on. > > I believe IPython does this. Check out >

Re: [Tutor] Use Python to learn kids (9 yr) to program

2006-11-29 Thread Senthil_OR
Andre Roberge wrote: > On 11/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > Playing with Guido Van Robot http://gvr.sf.net is another good > option to teach programming to young ones. Rurple is just another > graphic representation of the gvr. > > > > Not quite. G

Re: [Tutor] Use Python to learn kids (9 yr) to program

2006-11-29 Thread Senthil_OR
Hi, Playing with Guido Van Robot http://gvr.sf.net is another good option to teach programming to young ones. Rurple is just another graphic representation of the gvr. -- Senthil From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andre Rober

Re: [Tutor] OT: Vim was: free IDE for Python?

2006-11-17 Thread Senthil_OR
William O'Higgins Witteman wrote: > On Fri, Nov 17, 2006 at 11:02:18AM +0530, [EMAIL PROTECTED] wrote: > >> What the settings of ppl using vim for python? > > A few Python-specific things that I have in my .vimrc are as follows: Thanks for sharing William. I think ppl in this list , might also

Re: [Tutor] OT: Vim was: free IDE for Python?

2006-11-16 Thread Senthil_OR
Hi Alan, Greetings. Alan Gauld wrote: >> I have to chuckle when you recommend Vim for ease of use. > > Me too, and I've been a vi/elvis/viper/vim user for over 20 years(*). > vi/vim could never be described as easy to learn, but... I too use vim for a variety of editing tasks. From xml,

Re: [Tutor] documentation/sourceforge bug help

2006-10-30 Thread Senthil_OR
C or L Smith wrote: > I know this is off topic, but can anyone give me a hand? I have a > sourceforge account. I want to make a correction to the python > documentation. I click on the appropriate link at the bottom of the > documentation page and then the bug tracker link on the page that I > am s

Re: [Tutor] Trying tio emulate "diff" command of UNIX - please help

2006-10-06 Thread Senthil_OR
Hi,   Your program does not emulate the diff command of Unix. Please do a diff in unix and experience yourselves.   Where is cmp_res = stringcmp(string1[i],string2[i]) stringcmp() function written?   Moreover, if you Python Documentation install (or python.org accessible) search for diffli

Re: [Tutor] Inverse range

2006-09-06 Thread Senthil_OR
>> I am playing with Python. Playing as in learning. >> Is it possible to reverse a range sequence? If, for instance, I >> call: >> >> for f in range( 1,5 ): >> print f >> >> Is it possible to reverse it? As in: >> 4 >> 3 >> 2 >> 1 >Yes, there is a normally unused third parameter to range used t

Re: [Tutor] Hi, need help on zip commands for windows

2006-07-12 Thread Senthil_OR
There is no zip command in as such in windows. You can install www.7-zip.com software and trying withh command command line interface as belodw zip_command = "7z -a %s %s" % (target, ''.join(source))   If you like to zip files using python:   import zipfile #create a zipzipf = zipfile.ZipFil

Re: [Tutor] program-code dilemma

2006-07-05 Thread Senthil_OR
-Original Message- From: Damian Sent: Wednesday, July 05, 2006 12:36 PM To: tutor@python.org Subject: [Tutor] program-code dilemma Although, from what I've found I been able to get this conclusions. Program.- A sequence of instructions that can be executed by the computer. Code.

Re: [Tutor] Need python 2.4 rpm for Suse 9.1

2006-06-21 Thread Senthil_OR
try at rpmfind.net or google it. but the immediate thought which comes up in my mind is: "use the source, luke"   -- Senthil   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Akanksha GovilSent: Wednesday, June 21, 2006 5:36 PMTo: tutor@python.orgSubject: [Tutor] Need pytho

Re: [Tutor] C++ tutor

2006-02-21 Thread Senthil_OR
>I am a grad student at Berkeley looking for a C++ tutor. Might you >offer any suggestions? Thank you, http://groups.google.com/group/alt.comp.lang.learn.c-c++?lnk=li Is a list fot c,c++ similar to what this list serves for python. So, there u go. Senthil __

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Senthil_OR
>> bash: ./testerlybar.py: /usr/bin/python^M: bad interpreter: No such file or directory [EMAIL PROTECTED]:/media/windata$ Note the ^M the additional fileformat character inserted. That is causing the problem. Instead of copying and pasting try to use cp file1 file2. Else, open the copied file a

Re: [Tutor] Change files

2006-02-12 Thread Senthil_OR
David,  in getfiles, the os.getcwd() points the main programs cwd only and so shutil.copy() fails. so changing to name = os.path.join(root,name) helps us get the file in the directory we checked against.   def getfiles(file1,file2,top):    for root, dirs, files in os.walk(top):    for d