[Tutor] HI

2009-07-07 Thread Vishnu S
Sir/Madame, i'm a begginner to Python help me in putting the first step to this world With regards Vishnu S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] get_python_lib()

2008-01-15 Thread Vishnu Mohan
Kakada wrote: > Hi list, > > I was just wondering why the below function return different location on > different machine? > > import distutils.sysconfig > distutils.sysconfig.get_python_lib() > On my computer: > '/usr/lib/python2.5/site-packages' > On my friend's computer: > '/usr/local/lib/pytho

Re: [Tutor] Problem with while loop

2007-09-10 Thread Vishnu Mohan
> Now I just need to figure out how to only get 4 digit pin numbers :) > Use regular expressions The following is the code with re. from random import randint import re counter = 0 pinPattern = re.compile(r'^\d{4}$') howmany = raw_input( "How many: " ) if pinPattern.match(howmany): whil

Re: [Tutor] Automatic generation of an "all possible combinations" array

2007-06-14 Thread Vishnu Mohan
Another simplest way of doing it is >>> from random import * from sys import * def bin_list(n): bin_val = 0 if n >= 0: bin_val = 2**n - 1 list = [] while bin_val >= 0: list.append([((bin_val >> y) & 1) for y in range(n-1,-1,-1)]) bin_val -= 1 shuffle(

Re: [Tutor] locking files

2007-06-14 Thread Vishnu Mohan
You can look into the flock or lockf methods in fcntl module (or) the following link will help you http://www.python.org/doc/2.4/lib/module-fcntl.html VishnuMohan Alan Gauld wrote: "Jeff Peery" <[EMAIL PROTECTED]> wrote does anyone know if there is a way in python to lock a file so othe

Re: [Tutor] Tutor Digest, Vol 40, Issue 25

2007-06-12 Thread Vishnu Mohan
> > Message: 2 > Date: Sun, 10 Jun 2007 09:20:28 -0500 > From: David Hamilton <[EMAIL PROTECTED]> > Subject: [Tutor] Correct use of range function.. > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > I just finished doing an e

RE: [Tutor] Variables

2005-02-15 Thread Vishnu
I am forwarding this mail, since tutor@python.org is not added by Matt Hauser. Thank you, Vishnu. -Original Message- From: Matt Hauser [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 7:28 PM To: Vishnu Subject: Re: [Tutor] Variables #Create a list of people whoLovesPizza

RE: [Tutor] Variables

2005-02-15 Thread Vishnu
uot;I3"] = "John3" print "%{I1}s, %{I2}s and %{I3}s used to love pizza" % name HTH, Vishnu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ÃÃ ÃÃÂÂ Sent: Tuesday, February 15, 2005 4:18 PM To: tutor@python.org Subject: [Tutor] Variable