> I'm writing an application which will hold a database of people. Ofcourse,
> people can have the same name, so I want to stock them with an unique ID.
>
> I've searched and found some things:
> - uuid.uuid4()
> - id(name)
> - os.urandom(n)
>
> But they seem overkill to me. Well, maybe not id().
>
On Wed, Oct 28, 2009 at 1:34 PM, Robert Berman wrote:
> Hi,
>
> I am working on a practice problem called 'POINTS' on the CodeChef
> site:http://www.codechef.com/problems/POINTS/. This simply wants the sum
> of the distances between a number of points on a 2 dimensional plane.
> Looking at the pro
"Robert Berman" wrote
constructed. My point of confusion is in ordering the points. Given a
very simple example set of points:
The arrangement should be,
0 5
0 2
0 1
2 3
2 1
5 2
5 1
You might find the itertools.groupby function does most of what you need?
HTH,
Alan G.
__
"Nick Hird" wrote
I am running Windows XP.
On Wed, Oct 28, 2009 at 4:15 PM, Nick Hird wrote:
Is there a way in python to tell if the power source for a laptop is
ac or battery?
Search Microsoft Developer site (MSDN) for
GetSystemPowerStatus
which is the function that tests for batte
Oops I replied off list twice. (i wish they would just munge the addresses
*grumble**grumble*)
On Wed, Oct 28, 2009 at 11:34 AM, Robert Berman wrote:
Hi,
What I am looking for is a better, faster approach. I think there would
be a way to build a dictionary but you can't use the X values as keys
Hi,
I am working on a practice problem called 'POINTS' on the CodeChef
site:http://www.codechef.com/problems/POINTS/. This simply wants the sum
of the distances between a number of points on a 2 dimensional plane.
Looking at the problem, the algorithm to define the sum of the distances
between all
On Wed, Oct 28, 2009 at 4:28 PM, Nick Hird wrote:
> I am running Windows XP.
>
My advice applies then
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
I am running Windows XP.
On Wed, Oct 28, 2009 at 5:19 PM, Luke Paireepinart
wrote:
> If you're on Windows and you can find an example using the Win32 api (in C++
> for example) you can use pywin32 module to do the same thing through
> python. It's a little complicated sometimes though. So what
If you're on Windows and you can find an example using the Win32 api (in C++
for example) you can use pywin32 module to do the same thing through
python. It's a little complicated sometimes though. So what O.S. are you
on?
On Wed, Oct 28, 2009 at 4:15 PM, Nick Hird wrote:
> Is there a way in p
Is there a way in python to tell if the power source for a laptop is
ac or battery? I am trying to write a small script to print out my
system stats and would like to know if the laptop is on battery power
or using ac power. I just dont know enough python to know where to
look for that info.
Thank
> I'm writing an application which will hold a database of people. Ofcourse,
> people can have the same name, so I want to stock them with an unique ID.
>
If you're using an actual database rather than a plain old text file,
you can let the database do the work for you.
Most flavors (sqlite, post
On Wed, Oct 28, 2009 at 1:52 PM, Timo List wrote:
> Hello,
>
> I'm writing an application which will hold a database of people. Ofcourse,
> people can have the same name, so I want to stock them with an unique ID.
>
> I've searched and found some things:
> - uuid.uuid4()
> - id(name)
> - os.urand
Hello,
I'm writing an application which will hold a database of people. Ofcourse,
people can have the same name, so I want to stock them with an unique ID.
I've searched and found some things:
- uuid.uuid4()
- id(name)
- os.urandom(n)
But they seem overkill to me. Well, maybe not id().
What sho
I'm starting to learn PyQt. Can anyone recommend a good mailing list or forum?
Thanks.
"I'm the last person to pretend that I'm a radio. I'd rather go out and be a
color television set."
-David Bowie
"Who dares wins"
-British military motto
"There is no such thing as luck; there is only adeq
On Wed, Oct 28, 2009 at 11:16 AM, wrote:
> Well I would have to remote to the machine that contains the log file and
> copy it from there.
You are not being very helpful. What does "remote to the machine"
mean? What OS are you running? Some details would help.
Kent
PS Please don't top-post.
>
Well I would have to remote to the machine that contains the log file and copy
it from there.
-Original Message-
From: Kent Johnson
To: asteri...@petlover.com
Cc: *tutor python
Sent: Wed, Oct 28, 2009 1:18 pm
Subject: Re: [Tutor] New to Python
Forwarding to the list with my reply (
Remember to hit Reply to all
- Forwarding your message onto the list
-- Forwarded message --
From:
Date: Wed, Oct 28, 2009 at 1:00 AM
Subject: Re: [Tutor] New to Python
To: sri...@gmail.com
Hi Wayne,
I will try as best to explain what I need to do.
I have a log file. In t
On Wed, Oct 28, 2009 at 1:44 AM, Mahasen Dehideniya wrote:
> Hi ,
>
> I'm try to access PostGreSQL 8.3 by python 2.5. I'm working on winXP.
>
> I use pg module.
>
> At the first time i get error that no found dll. when i add C:\Program
> Files\PostgreSQL\8.3\bin to the path variable i able to fix
Forwarding to the list with my reply (please use Reply All to reply to
the list):
On Wed, Oct 28, 2009 at 2:01 AM, wrote:
> Hi Kent,
>
> Thank you for replying to my request, really appreciate it.
>
> I am not familiar with all your connections that you have mentioned below.
>
> What I can tell
Hi ,
I'm try to access PostGreSQL 8.3 by python 2.5. I'm working on winXP.
I use pg module.
At the first time i get error that no found dll. when i add C:\Program
Files\PostgreSQL\8.3\bin to the path variable i able to fixed it.
After that i get following error.
>>> import pg
Traceback (mo
Remember to hit Reply to all
- Forwarding your message onto the list
-- Forwarded message --
From:
Date: Wed, Oct 28, 2009 at 1:00 AM
Subject: Re: [Tutor] New to Python
To: sri...@gmail.com
Hi Wayne,
I will try as best to explain what I need to do.
I have a log file. In that
...
>> Assume I have a dict, 'foo'. I also have my own class, 'Bar', which
>> subclasses (i.e. is a derived class) of a dict. How do I eloquently
>> get foo into an instace of Bar? Example:
>>
>>
>> ### BEGIN CODE:
>> class Bar(dict):
>>pass # Act like a dict for now.
>>
>> foo = {'a': 100, 'b
22 matches
Mail list logo