Re: Strings and Lists

2005-04-18 Thread Sidharth Kuruvila
Hi, I not sure what sorts of operations you plan to do. But if you intend to use fixed length arrays or even carrying out repetetive operations. You should probably look at numeric http://numeric.scipy.org/ On 18 Apr 2005 04:42:17 -0700, Tom Longridge <[EMAIL PROTECTED]> wrote: > My current Py

Re: How to check whether a list have specific value exist or not?

2005-04-09 Thread Sidharth Kuruvila
Hi Prabha, if 3 in [1, 2, 3, 4]: print "yes" Python is an amazing language if you understand that it is actually quite a bit different from php. The python tutorial is pretty good, I suggest you go through it. On Apr 9, 2005 3:07 PM, Michael Spencer <[EMAIL PROTECTED]> wrote: > praba kar w

Re: check instace already running...

2005-04-09 Thread Sidharth Kuruvila
quot;there is an instance already running" else: file(lockfile, "w").close() atexit.register(lambda:os.remove(lockfile)) //Your code here On Apr 9, 2005 2:32 PM, Sidharth Kuruvila <[EMAIL PROTECTED]> wrote: > I haven't tested this. There is probably a better

Re: Declaring variables from a list

2005-04-08 Thread Sidharth Kuruvila
What I gave was a bad solution. Something that works right now, but probably shouldn't be done. On Apr 9, 2005 3:37 AM, Inyeol Lee <[EMAIL PROTECTED]> wrote: > On Sat, Apr 09, 2005 at 03:15:01AM +0530, Sidharth Kuruvila wrote: > > Python has a builtin function called loca

Re: Declaring variables from a list

2005-04-08 Thread Sidharth Kuruvila
Python has a builtin function called locals which returns the local context as a dictionary >>> locals = locals() >>> locals["a"] = 5 >>> a 5 >>> locals["a"] = "changed" >>> a 'changed' On 8 Apr 2005 13:55:39 -0700, Cactus <[EMAIL PROTECTED]> wrote: > Hi, > > If I got a list is it possible to de

Re: Exception Handling

2005-04-08 Thread Sidharth Kuruvila
Have a look at the chapter on exceptions in the python tutorial its pretty good. http://docs.python.org/tut/node10.html On 8 Apr 2005 14:29:40 -0700, SuperJared <[EMAIL PROTECTED]> wrote: > I'm new to Python, well versed in PHP and a bit of Perl. > > I've written a simple backup utility that FTPs

Re: compound strip() string problem

2005-04-08 Thread Sidharth Kuruvila
The time module has a function called 'strftime' which can retyrn the time in the the format you want to. So you really don't need to parse the string returned by asctime the way you are doing. On Apr 8, 2005 6:01 PM, Dylan Wilson <[EMAIL PROTECTED]> wrote: > Hi, > I'm new to python and i have a

Re: how can I extract all urls in a string by using re.findall() ?

2005-04-06 Thread Sidharth Kuruvila
Reading the documentation on re might be helpfull here :-P findall returns a tuple of all the groups in each match. You might find finditer usefull. for m in re.finditer(url, html) : print m.group() or you could replace all your paranthesis with the non-grouping version. That is, all bracke