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
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
> 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
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(
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
>
> 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
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
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