Modules or Package for my application

2012-11-27 Thread Stone
Dear developers,

I am creating application (originally written in perl) 
which will take care about replication from one system to the another system 
over command rsync. It will simulate High-availability solution.

The application will contains main module called like ha.py
and another modules will have names Replication.py, Trace.py, Misc.py, 
Procs.py, Constants.py, Lan.py, Display.py

My questions are:
1) When I would like to make a global logging to the one file is it enough to 
do that like
TRACE='/var/ha/log/sso_trace.log'
logger = logging.getLogger('sso')
hdrl = logging.FileHandler(TRACE)
formatter = logging.Formatter('%{asctime}s %{levelname}s %{message}s')
hdrl.setFormatter(formatter)
logger.addHandler(hdrl)
logger.setLevel(logging.WARNING)
and make for them one module or how to solve that?
How to call that logger from all modules / packages?
Is it necessary to create alone module?

2) Is it package necessary or simply modules are enough
- Replication.py will take care about alone replication
- Procs.py will take care about some processes
- Constants.py will take care about definition of global constants
- Lan.py will take care about LAN definition
- Dipslay.py will take care about showing screen (GUI or text_based)
3) How / where to define global variables?

best regards
Petr
-- 
http://mail.python.org/mailman/listinfo/python-list


Python printout

2012-11-27 Thread Avrajit
I have multiple list and want to invoke a single prinout which will give a 
print preview of all list in Grid format in a different pages. I have tried 
wx.lib.printout.PrintTable but it takes only one table at a time. Any clues how 
to achieve this?
-- 
http://mail.python.org/mailman/listinfo/python-list


changing dicts in a threaded environment ?

2012-11-27 Thread Bart Thate
Hello All ;]

i wondered if somebody could bring me up to date on the following subject:

i use python3 now and i need to be able to remove elements from a dict in a
thread safe manner.

kinda like a Queue.Queue thing but then in a dict, so i can pass arond  my
dict based objects as parameters arond without having to wonder if it gets
properly locked.

So not only do i need to get this solved:

Issue #14417 : Mutating a dict during lookup
now restarts the lookup instead of raising a RuntimeError (undoes issue
#14205 ).

i also need to lock all the actual modifying underlying "real" stuff as
well not just the iterator or view or whatever i don't know yet ;]

So my question is kinda like, is a dict possible in the same way the
Queue.Queue is now made truely thread safe ?

Also is there something like a select.select for queues ?

I want to pass a dict to a thead and then have a watcher on the dicts state
if result have arrived.

For what i am making dicts are the basis of everything, json dumpable so
the state op the object can be saved or send over the wire as well.

Thnx for your time and energy ;]

Grtx,

Bart
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compare list entry from csv files

2012-11-27 Thread Anatoli Hristov
On Tue, Nov 27, 2012 at 4:23 AM, Dave Angel  wrote:
> On 11/26/2012 05:27 PM, Anatoli Hristov wrote:
>> I understand, but in my case I have for sure the field "Name" in the
>> second file that contains at least the first or the last name on it...
>> So probably it should be possible:)
>> The Name "Billgatesmicrosoft" contains the word "Gates" so logically I
>> might find a solution for it.
>>
>
> (Please don't top-post.  Or if you must, then delete everything after
> your post, as I'm doing here.  Otherwise you end up with insanities like
> new stuff, quote-4, quote-1, quote-3, quote-2.  In this case, long
> tradition on this forum and many like it work well, even if Microsoft
> mail programs and some others decide to put the cursor at the wrong end
> of the existing text.  In most programs, it's configurable.)
>
> If you can come up with an algorithm for comparing first+last in one
> file to name in the other, then the problem can be solved.  But you
> can't do it by hand-waving, you have to actually figure out a mechanism.
>  Then we can help you code such a thing.  And I can just about guarantee
> that if these fields are created independently by human beings, that
> there will be exceptions that have to fixed by human beings.
>
>
> --
>
> DaveA

Thanks for your help. I will do my best for the forum :)

I advanced a little bit with the algorithm and at least I can now
extract and compare the fields :)
For my beginner skills I think this is too much for me. Now next step
is to add the second field with the number to the Namelist and copy it
to a third filename I suppose.

import csv

origf = open('c:/Working/Test_phonebook.csv', 'rt')
secfile = open('c:/Working/phones.csv', 'rt')

phonelist = []
namelist = []

names = csv.reader(origf, delimiter=';')
phones = csv.reader(secfile, delimiter=';')
for tel in phones:
phonelist.append(tel)

#print "*"*25,phonelist,"*"*25
rows = 0

def finder(name_row):
for ex_phone in phonelist:
#phonelist.append(tel)
telstr = ex_phone[0].lower()
#print "*"*25 + " I got %s" % telstr
#print "\nGot name from Name_Find :%s" % name_row
if telstr.find(name_row) >= 0:
print "\nName found: %s" % name_row
else:
pass
return
#print "\nNot found %s" % name_row

def name_find():

for row in names:
namelist.append(row)
name_row = row[0].lower()
#print "\nExtracted Name is :% s" % name_row
finder(name_row)
#name_find()
#rows = rows +1
name_find()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compare list entry from csv files

2012-11-27 Thread Neil Cerutti
On 2012-11-27, Anatoli Hristov  wrote:
> Thanks for your help. I will do my best for the forum :)
>
> I advanced a little bit with the algorithm and at least I can
> now extract and compare the fields :) For my beginner skills I
> think this is too much for me. Now next step is to add the
> second field with the number to the Namelist and copy it to a
> third filename I suppose.

I had to write a similar type of program, and I imagine it's a
common problem. Sometimes new students provide incorrect SSN's or
simply leave them blank. This makes it impossible for us to match
their application for financial aid to their admissions record.

You have to analyze how you're going to match records.

In my case, missing SSN's are one case. A likeley match in this
case is when the names are eerily similar.

In the other case, where they simply got their SSN wrong, I have
to check for both a similar SSN and a similar name.

But you still have to define "similar." I looked up an algorithm
on the web called Levenshtein Distance, and implemented it like
so.

def levenshteindistance(first, second):
"""Find the Levenshtein distance between two strings."""
if len(first) > len(second):
first, second = second, first
if len(second) == 0:
return len(first)
first_length = len(first) + 1
second_length = len(second) + 1
distance_matrix = [[0] * second_length for x in range(first_length)]
for i in range(first_length):
   distance_matrix[i][0] = i
for j in range(second_length):
   distance_matrix[0][j]=j
for i in range(1, first_length):
for j in range(1, second_length):
deletion = distance_matrix[i-1][j] + 1
insertion = distance_matrix[i][j-1] + 1
substitution = distance_matrix[i-1][j-1]
if first[i-1] != second[j-1]:
substitution += 1
distance_matrix[i][j] = min(insertion, deletion, substitution)
return distance_matrix[first_length-1][second_length-1]

The algorithm return a count of every difference between the two
strings, from 0 to the length of the longest string.

Python provides difflib, which implements a similar algorithm, so
I used that as well (kinda awkwardly). I used
difflib.get_close_matches to get candidates, and then
difflib.SequenceMatcher to provide me a score measuring the
closeness.

matches = difflib.get_close_matches(s1, s2)
for m in matches:
scorer = difflib.SequenceMatcher(None, s1, m)
ratio = scorer.ratio()
if ratio == 0.0:
# perfect match
if ratio > MAX_RATIO: # You gotta choose this. I used 0.1 
# close match

The two algorithms come up with different guesses, and I pass on
their suggestions for fixes to a human being. Both versions of
the program take roughly 5 minutes to run the comparison on
2000-12000 records between the two files.

I like the results of Levenshtein distance a little better, but
difflib finds some stuff that it misses.

In your case, the name is munged horribly in one of the files so
you'll first have to first sort it out somehow.

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list


How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread san
Please let me know how to sort the list of String in either ascending / 
descending order without considering special characters and case.
ex: list1=['test1_two','testOne','testTwo','test_one']
Applying the list.sort /sorted method results in sorted list ['test1_two', 
'testOne', 'testTwo', 'test_one']
but the without considering the special characters and case it should be 
['testOne','test_one', 'test1_two','testTwo'] OR 
['test_one','testOne','testTwo', 'test1_two' ]

list.sort /sorted method sorts based on the ascii value of the characters but 
Please let me knwo how do i achieve my expected one
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Migrate from Access 2010 / VBA

2012-11-27 Thread kagard
On Nov 26, 11:21 am, Michael Torrie  wrote:
> On 11/22/2012 08:19 PM, kgard wrote:
>
> > I am the lone developer of db apps at a company of 350+ employees.
> > Everything is done in MS Access 2010 and VBA. I'm frustrated with the
> > limitations of this platform and have been considering switching to
> > Python. I've been experimenting with the language for a year or so,
> > and feel comfortable with the basics.
>
> Python is just a language, just like VBA itself is just a language.  You
> can't just replace an MS Access VBA app with one in Python.  You have to
> replace your *tools* with open source alternatives, that hopefully
> python can glue together.  Wolfgang provided a nice list of such tools.
>
> One program that claims to be working towards Access replacement is
> Kexi.  It's not written in Python, but I think it does use Python as a
> scripting language, just as Access uses VBA.  I doubt it's anywhere near
> Access yet, but it's worth a look:
>
> http://kexi-project.org/about.html
>
> > 
> > Has anyone here made this transition successfully? If so, could you
> > pass along your suggestions about how to do this as quickly and
> > painlessly as possible?
>
> It will not be painless at all.  There is no "transition" path, really.
>  That's partly the result of Microsoft product lock-in, partly because
> you want to replace a complete system that happens to be glued together
> with, simply, "Python."
>
> I think Python could be a great fit if you could find the right tools to
> go with it, but it's not going to be easy at all.  Complete MS Access
> replacements is one of the may extremely weak spots in the open source
> world.  Partly because web-based apps often work better than a desktop
> DB solution, and you might want to go there too, perhaps using a python
> web development toolkit like django.
>
>

I understand your comment about replacing tools. Since things tend to
fall apart at the seams, though, I wouldn't mind keeping the seams to
a minumum. That's why I had been thinking about something like Django
or Web2Py. Web2Py seems to more correctly represent MVC, and I like
that its template scripting mirrors Python syntal.

Thanks for your reply.

I will now cower at my keyboard and await my "Django kicks Web2Py's
butt" lashing.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread MRAB

On 2012-11-27 17:31, san wrote:

Please let me know how to sort the list of String in either ascending / 
descending order without considering special characters and case.
ex: list1=['test1_two','testOne','testTwo','test_one']
Applying the list.sort /sorted method results in sorted list ['test1_two', 
'testOne', 'testTwo', 'test_one']
but the without considering the special characters and case it should be
['testOne','test_one', 'test1_two','testTwo'] OR 
['test_one','testOne','testTwo', 'test1_two' ]

list.sort /sorted method sorts based on the ascii value of the characters but 
Please let me knwo how do i achieve my expected one


(I'm using Python 3.)

The .sort method accepts a 'key' argument, which lets you pass a
function that transforms the value being sorted before comparison:

>>> def make_key(string):
return string.replace('_', '').upper()

>>> list1 = ['test1_two', 'testOne', 'testTwo', 'test_one']
>>> list1.sort(key=make_key)
>>> list1
['test1_two', 'testOne', 'test_one', 'testTwo']

I don't know how you define 'special'.

You could remove any characters which are special or keep any
characters which are not special, depending on how many characters are
defined as 'special':

from string import ascii_letters

# Sets are faster for this kind of thing.
ascii_letters = set(ascii_letters)

def make_key(string):
return ''.join(c for c in string if c in ascii_letters).upper()

list1 = ['test1_two', 'testOne', 'testTwo', 'test_one']
list1.sort(key=make_key)

print(list1)

# Output is: ['testOne', 'test_one', 'test1_two', 'testTwo']

--
http://mail.python.org/mailman/listinfo/python-list


os.popen and the subprocess module

2012-11-27 Thread Andrew

Hello world,

I'm working on a script that will run an executable obtaine the output  
from the executable
and do some analysis on the output. Essentially the script runs the  
executable analyses

the data.
I'm looking into os.popen and the subprocess module, implementing os.popen  
is easy but i hear
it is depreciating  however I'm finding the implemantation of subprocess  
daunting can anyone help


Dx
--
守破離(shuhari)first learn, then detach, and finally transcend
--
http://mail.python.org/mailman/listinfo/python-list


RE: os.popen and the subprocess module

2012-11-27 Thread Prasad, Ramit
Andrew wrote:
> 
> Hello world,
> 
> I'm working on a script that will run an executable obtaine the output
>  from the executable
> and do some analysis on the output. Essentially the script runs the
> executable analyses
> the data.
> I'm looking into os.popen and the subprocess module, implementing os.popen
> is easy but i hear
> it is depreciating  however I'm finding the implemantation of subprocess
> daunting can anyone help
> 

Have you read the documentation?

http://docs.python.org/library/subprocess.html#replacing-older-functions-with-the-subprocess-module
(specifically 17.1.4.5)

This may help as well.
http://www.doughellmann.com/PyMOTW/subprocess/#capturing-output

Note, use of shell=True is usually discouraged as it can be
unsafe.


~Ramit



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os.popen and the subprocess module

2012-11-27 Thread Mark Lawrence

On 27/11/2012 18:00, Andrew wrote:

Hello world,

I'm working on a script that will run an executable obtaine the output
from the executable
and do some analysis on the output. Essentially the script runs the
executable analyses
the data.
I'm looking into os.popen and the subprocess module, implementing
os.popen is easy but i hear
it is depreciating  however I'm finding the implemantation of subprocess
daunting can anyone help

Dx


os.popen is alive and kicking in Python 3.3, see here 
http://bugs.python.org/issue6490 for more.  And I think you meant 
deprecated :)


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


RE: How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread Prasad, Ramit
san wrote:
> 
> Please let me know how to sort the list of String in either ascending / 
> descending order without considering
> special characters and case.
> ex: list1=['test1_two','testOne','testTwo','test_one']
> Applying the list.sort /sorted method results in sorted list ['test1_two', 
> 'testOne', 'testTwo', 'test_one']
> but the without considering the special characters and case it should be
> ['testOne','test_one', 'test1_two','testTwo'] OR 
> ['test_one','testOne','testTwo', 'test1_two' ]
> 
> list.sort /sorted method sorts based on the ascii value of the characters but 
> Please let me knwo how do i
> achieve my expected one

You can pass a key function into list.sort() and sorted(). This
allows you to customize the sorting. In the below examples
I use lambda but you can use a non-lambda function (if you need
more complexity).

Case insensitive searches are often done by converting the 
strings being compared into the same case. Here I turned
them all uppercase.

lst = ['test1_two', 'testOne', 'testTwo', 'test_one']
lst.sort(key=lambda x: x.upper())

This will filter non-alphanumeric characters. You may
be able to create and use a translation table instead.

lst.sort( key=lambda x: ''.join( c.upper() for c in x if c 
in string.letters+string.digits ) )


~Ramit



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compare list entry from csv files

2012-11-27 Thread Anatoli Hristov
On Tue, Nov 27, 2012 at 4:05 PM, Neil Cerutti  wrote:
> On 2012-11-27, Anatoli Hristov  wrote:
>> Thanks for your help. I will do my best for the forum :)
>>
>> I advanced a little bit with the algorithm and at least I can
>> now extract and compare the fields :) For my beginner skills I
>> think this is too much for me. Now next step is to add the
>> second field with the number to the Namelist and copy it to a
>> third filename I suppose.
>
> I had to write a similar type of program, and I imagine it's a
> common problem. Sometimes new students provide incorrect SSN's or
> simply leave them blank. This makes it impossible for us to match
> their application for financial aid to their admissions record.
>
> You have to analyze how you're going to match records.
>
> In my case, missing SSN's are one case. A likeley match in this
> case is when the names are eerily similar.
>
> In the other case, where they simply got their SSN wrong, I have
> to check for both a similar SSN and a similar name.
>
> But you still have to define "similar." I looked up an algorithm
> on the web called Levenshtein Distance, and implemented it like
> so.
>
> def levenshteindistance(first, second):
> """Find the Levenshtein distance between two strings."""
> if len(first) > len(second):
> first, second = second, first
> if len(second) == 0:
> return len(first)
> first_length = len(first) + 1
> second_length = len(second) + 1
> distance_matrix = [[0] * second_length for x in range(first_length)]
> for i in range(first_length):
>distance_matrix[i][0] = i
> for j in range(second_length):
>distance_matrix[0][j]=j
> for i in range(1, first_length):
> for j in range(1, second_length):
> deletion = distance_matrix[i-1][j] + 1
> insertion = distance_matrix[i][j-1] + 1
> substitution = distance_matrix[i-1][j-1]
> if first[i-1] != second[j-1]:
> substitution += 1
> distance_matrix[i][j] = min(insertion, deletion, substitution)
> return distance_matrix[first_length-1][second_length-1]
>
> The algorithm return a count of every difference between the two
> strings, from 0 to the length of the longest string.
>
> Python provides difflib, which implements a similar algorithm, so
> I used that as well (kinda awkwardly). I used
> difflib.get_close_matches to get candidates, and then
> difflib.SequenceMatcher to provide me a score measuring the
> closeness.
>
> matches = difflib.get_close_matches(s1, s2)
> for m in matches:
> scorer = difflib.SequenceMatcher(None, s1, m)
> ratio = scorer.ratio()
> if ratio == 0.0:
> # perfect match
> if ratio > MAX_RATIO: # You gotta choose this. I used 0.1
> # close match
>
> The two algorithms come up with different guesses, and I pass on
> their suggestions for fixes to a human being. Both versions of
> the program take roughly 5 minutes to run the comparison on
> 2000-12000 records between the two files.
>
> I like the results of Levenshtein distance a little better, but
> difflib finds some stuff that it misses.
>
> In your case, the name is munged horribly in one of the files so
> you'll first have to first sort it out somehow.
>
> --
> Neil Cerutti
> --
> http://mail.python.org/mailman/listinfo/python-list


Thank you all for the help, but I figured that out and the program now
works perfect. I would appreciate if you have some notes about my
script as I'm noob :)
Here is the code:

import csv

origf = open('c:/Working/Test_phonebook.csv', 'rt')
secfile = open('c:/Working/phones.csv', 'rt')

phonelist = []
namelist = []

names = csv.reader(origf, delimiter=';')
phones = csv.reader(secfile, delimiter=';')
for tel in phones:
phonelist.append(tel)



def finder(name_row,rows):
for ex_phone in phonelist:
telstr = ex_phone[0].lower()
if telstr.find(name_row) >= 0:
print "\nName found: %s" % name_row
namelist[rows][-1] = ex_phone[-1].lower()
else:
pass
return

def name_find():
rows = 0
for row in names:
namelist.append(row)
name_row = row[0].lower()
finder(name_row,rows)
rows = rows+1
name_find()
ofile  = open('c:/Working/ttest.csv', "wb")
writer = csv.writer(wfile, delimiter=';')
for insert in namelist:
writer.writerow(insert)
wfile.close()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: changing dicts in a threaded environment ?

2012-11-27 Thread Terry Reedy

On 11/27/2012 7:53 AM, Bart Thate wrote:

[Answers based on reading without thread experience.]


i use python3 now and i need to be able to remove elements from a dict
in a thread safe manner.


Essentially no change from py2.


kinda like a Queue.Queue thing but then in a dict, so i can pass arond
  my dict based objects as parameters arond without having to wonder if
it gets properly locked.


As I understand it, dicts do not get locked unless you do it.


So not only do i need to get this solved:

Issue #14417 : Mutating a dict during
lookup now restarts the lookup instead of raising a RuntimeError (undoes
issue #14205 ).


As I understand #14417, you should be explicitly locking dicts. The 
issue in #14205 was that people doing mutations in just one thread and 
lookups in others usually got away without locking becuase of recursive 
retries, but occasionally crashed the interpreter because of them. The 
first fix was to prevent crashes by removing retries. But that would 
break programs that naively worked because of them. The second fix was 
to do iterative retries instead, so a thread might occasionally hang, 
but without crashing.


As I understand it, it is better to not be a naive user.


i also need to lock all the actual modifying underlying "real" stuff as
well not just the iterator or view or whatever i don't know yet ;]


I am not sure what you are asking.


So my question is kinda like, is a dict possible in the same way the
Queue.Queue is now made truely thread safe ?


A custom dict might be but the builtin is not. Queue is somewhat unique 
as a builtin designed for threads.



Also is there something like a select.select for queues ?


Have you searched?


I want to pass a dict to a thead and then have a watcher on the dicts
state if result have arrived.


Builtin dicts do not have an 'I have changed flag. You would need to 
subclass or probably better, wrap a dict using the appropriate pattern. 
Perhaps done already, but you want a wrapper that does both locking and 
watcher notification.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: Migrate from Access 2010 / VBA

2012-11-27 Thread Wolfgang Keller
> One program that claims to be working towards Access replacement is
> Kexi.  It's not written in Python, but I think it does use Python as a
> scripting language, just as Access uses VBA.  I doubt it's anywhere
> near Access yet, but it's worth a look:
> 
> http://kexi-project.org/about.html

Unfortunately, Kexi doesn't support composite keys yet, so it's
essentially useless for real-world databases so far. :-(

Rekall appears to be dead and so does Knoda.

Sincerely,

Wolfgang
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Migrate from Access 2010 / VBA

2012-11-27 Thread Wolfgang Keller
> The reporting question is the one that gives me the greatest concern
> when I think about switching to Python.

Not Python, but FOSS, cross-platform and it works with PostgreSQL:

http://www.xtuple.com/openrpt

Apart from that one, among the mentioned DB RAD frameworks, at least
Dabo and Camelot include report builders.

And, again; Libreoffice Base comes with a reporting framework, although
the latest version afaik has a currently unresolved bug, so you'll have
to retrograde to an older version if you want to use it.

Sincerely,

Wolfgang
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compare list entry from csv files

2012-11-27 Thread Dave Angel
On 11/27/2012 01:57 PM, Anatoli Hristov wrote:
> 
>
> Thank you all for the help, but I figured that out and the program now
> works perfect.

Wow!

>  I would appreciate if you have some notes about my
> script as I'm noob :)
> Here is the code:
>
> import csv
>
> origf = open('c:/Working/Test_phonebook.csv', 'rt')
> secfile = open('c:/Working/phones.csv', 'rt')
I cannot tell which of these files is which, since you use different
names than you did in your example text of the OP.

> phonelist = []
> namelist = []
> names = csv.reader(origf, delimiter=';')
> phones = csv.reader(secfile, delimiter=';')
> for tel in phones:
> phonelist.append(tel)
Is phonelist the one that has just two fields:  name & phone number?

secfile.close()
del phones

Why don't you populate the namelist in the same way, so that it's clear
what's going on ?

origf.close()
del names
Two many globals, being referenced directly in functions.  It's fine to
have them, but if they're const, like PHONELIST, then make them
uppercase.  If they're not, then pass them into the functions where used.
>
>
> def finder(name_row,rows):
> for ex_phone in phonelist:
> telstr = ex_phone[0].lower()
> if telstr.find(name_row) >= 0:
So will this logic find a match between a Mr. Jones living in the city
of Townsend and a Mr. Townsend that you have a phone number for?  Or do
I have the files backward, and this will compare the first name from one
file to the phone number from the other?
> print "\nName found: %s" % name_row
> namelist[rows][-1] = ex_phone[-1].lower()
 return   #otherwise, we might find multiple matches
> else:
> pass
Need a print message here indicating that no name matched.  Otherwise,
you just think it worked.
> return
>
> def name_find():
> rows = 0
No need to keep your own index, since finder() can just adjust the list
directly, without having to reach into globals.


> for row in names:
for row_num, row in enumerate(names):   #(if you actually needed such an
index)
> namelist.append(row)
> name_row = row[0].lower()
Might this actually be first_name ?  i find it very confusing to store a
string in a variable with the word row in it.
> finder(name_row,rows)
> rows = rows+1

All the initialization you had at the beginning belongs here, and it
also belongs inside an  if __name__ == "__main__": clause

Even better, it all belongs in a function, which returns the two lists
you're going to work with.

> name_find()
> ofile  = open('c:/Working/ttest.csv', "wb")
> writer = csv.writer(wfile, delimiter=';')
What is wfile?   Looks undefined to me.
> for insert in namelist:
> writer.writerow(insert)
> wfile.close()

I really think you need to document the matching pattern you're trying
to implement, and then we can worry about whether the code correctly
implements that algorithm.  Finally, we can worry about clarity of the code.

-- 

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compare list entry from csv files

2012-11-27 Thread Neil Cerutti
On 2012-11-27, Anatoli Hristov  wrote:
> Thank you all for the help, but I figured that out and the
> program now works perfect. I would appreciate if you have some
> notes about my script as I'm noob :) Here is the code:
>
> import csv
>
> origf = open('c:/Working/Test_phonebook.csv', 'rt')
> secfile = open('c:/Working/phones.csv', 'rt')

csv module expects files to be opened in binary mode in Python
versions less than version 3.0. For Python versions >= 3.0, you
use the special keyword argument, newlines='', instead.

> phonelist = []
> namelist = []

The structure of your program is poor. It's workable for such a
short script, and sometimes my first cuts are similar, but it's
better to get out of the habit right away.

Once you get this working the way you'd like you should clean up
the structure as a service to your future self.

> names = csv.reader(origf, delimiter=';')
> phones = csv.reader(secfile, delimiter=';')

You csv files don't seem to have header rows, but even so you can
improve your code by providing fieldnames and using a DictReader
instead.

name_reader = csv.DictReader(origf, fieldnames=[
 'Name', 'Blah', 'Phone#'])

Then you can read from records with

  name = row['Name']

instead of using bare, undocumented integers.

> for tel in phones:
> phonelist.append(tel)
>
> def finder(name_row,rows):
> for ex_phone in phonelist:
> telstr = ex_phone[0].lower()
> if telstr.find(name_row) >= 0:

This strikes me as a crude way to match names. You don't really
want Donald to match perfectly with McDonald, do you? Or for
Smith to match with Smithfield?

Yes, a human being will clean it up, but your program can do a
better job.

> print "\nName found: %s" % name_row
> namelist[rows][-1] = ex_phone[-1].lower()
> else:
> pass
> return
>
> def name_find():
> rows = 0
> for row in names:
> namelist.append(row)
> name_row = row[0].lower()
> finder(name_row,rows)
> rows = rows+1

You can use the useful enumerate function instead of your own
counter.

  for rows, row in enumerate(names):

...though I would find 'rownum' or 'num' or just 'i' better than
the name 'rows', which I find confusing.

> name_find()
> ofile  = open('c:/Working/ttest.csv', "wb")
> writer = csv.writer(wfile, delimiter=';')
> for insert in namelist:
> writer.writerow(insert)
> wfile.close()

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Re: Managing multiple packages

2012-11-27 Thread Thomas Bach
On Mon, Nov 26, 2012 at 07:58:22PM -0600, Evan Driscoll wrote:
> I'm also pretty confused about the
> distutils/setuptools/distribute/distutils2 landscape and what the
> differences are (at least between the first 3) and what their
> relationships with standard Python are.

In my opinion packaging in Python is at the moment a disaster. The
whole distutils/setuptools/whatever confusion is at least one of the
major sources that this whole topic is so poorly documented and
obviously violates the Zen of Python. Anyways, I think THEY are
working on it. [1] is also a bit clarifying.

Regards,
Thomas.


Footnotes: 
[1]  
http://ziade.org/2010/03/03/the-fate-of-distutils-pycon-summit-packaging-sprint-detailed-report/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bugs: Content-Length not updated by reused urllib.request.Request / has_header() case-sensitive

2012-11-27 Thread Terry Reedy

On 11/12/2012 8:58 PM, Terry Reedy wrote:

On 11/12/2012 4:35 PM, Terry Reedy wrote:


import urllib.request
opener = urllib.request.build_opener()
request = urllib.request.Request("http://example.com/";, headers =
 {"Content-Type": "application/x-www-form-urlencoded"})

opener.open(request, "1".encode("us-ascii"))
print(request.data, '\n', request.header_items())

opener.open(request, "123456789".encode("us-ascii"))
print(request.data, '\n', request.header_items())

exhibits the same behavior in 3.3.0 of printing ('Content-length', '1')
in the last output. I agree that that looks wrong, but I do not know if
such re-use is supposed to be supported.


I opened http://bugs.python.org/issue16464


A patch has been written by Alexey Kachayev and pushed by Andrew Svetlov 
and the behavior will change in 3.4.0 to allow reuse.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


deepcopy questions

2012-11-27 Thread lars van gemerden
Hi,

I get a very strange result when using deepcopy. The following code:

def __deepcopy__(self, memo):
independent = self.independent()
if independent is self:
out = type(self)()
out.__dict__ = copy.deepcopy(self.__dict__, memo)
print self.__dict__
print out.__dict__ #strange result
return out
else:
return copy.deepcopy(independent, memo).find(self.id).take()

prints different results for self.__dict__ and out.__dict__:

{'_active_': False, 'init': {}, '_id_': 0, '_items_': [], '_name_': 'main'} 
{'_active_': False, 'init': {}, '_id_': 0}

Two items are missing in the copy. Maybe i am missing something obvious, but i 
cannot figure out how this could happen.

Can anyone tell me how this is possible?

Cheers, Lars 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Migrate from Access 2010 / VBA

2012-11-27 Thread David Bolen
kgard  writes:

> I am the lone developer of db apps at a company of 350+
> employees. Everything is done in MS Access 2010 and VBA. I'm
> frustrated with the limitations of this platform and have been
> considering switching to Python. I've been experimenting with the
> language for a year or so, and feel comfortable with the basics.
(...)
> Has anyone here made this transition successfully? If so, could you
> pass along your suggestions about how to do this as quickly and
> painlessly as possible?

I went through a very similar transition a few years ago from
standalone Access databases (with GUI forms, queries and reports, as
well as replication) to a pure web application with full reporting
(albeit centrally designed and not a report designer for users).

I suppose my best overall suggestion is to migrate the data first and
independently of any other activities.  Unless your uses for Access in
terms of GUI or reporting are extremely limited, don't try to replace
your current system in one swoop, and in particular, be willing to
continue allowing Access as long as necessary for GUI/reports until
you're sure you've matched any current capabilities with an alternate
approach.  For all its warts, as a database GUI and reporting tool,
Access has a lot going for it, and it can be more complex than you may
think to replicate elsewhere.

So the first thing I would suggest is to plan and implement a
migration of the data itself.  In my case I migrated the data from
Access into PostgreSQL.  That process itself took some planning and
testing in terms of moving the data, and then correcting various bits
of the schemas and data types (if I recall, booleans didn't round-trip
properly at first), so was actually a series of conversions until I
was happy, during which time everyone was using Access as usual.

To support the migration, I created a mirror Access database to the
production version, but instead of local Jet tables, I linked all the
tables to the PostgreSQL server. All other aspects of the Access
database (e.g., forms, reports, queries) remained the same, just now
working off of the remote data.  This needed testing too - for
example, some multi-level joining in Access queries can be an issue.
In some cases it was easier for me to migrate selected Access query
logic into a database view and then replace the query in Access to use
the view.  You also need to (painfully) set any UI aspects of the
table definitions manually since the linking process doesn't set that
up, for which I used the original Access db as a model.  I ended up doing
that multiple times as I evolved the linked database, and I'll admit that
was seriously tedious.

While not required, I also wrapped up my new linked Access database
into a simple installer (InnoSetup based in my case).  Prior to this
everyone was just copying the mdb file around, but afterwards I had an
installer they just ran to be sure they had the latest version.

If you do this part carefully, for your end users, aside from
installing the new database, they see absolutely no difference, but
you now have easy central access to the data, and most importantly can
write other applications and tools against it without touching the
Access side.  It turns Access into just your GUI and reporting tool.

If you have power users that make local changes they can continue to
design additional queries or reports in their own local mdb against
the linked tables.  They'll need some extra support for updates
though, either instructions to re-link, or instructions on exporting
and importing their local changes into a newly installed version of
your master mdb.

Having done this, you are then free to start implementing, for
example, a web based application to start taking over functionality.
The nice thing is that you need not replicate everything at once, you
can start slow or with the most desirable features, letting Access
continue to handle the less common or more grungy legacy stuff at
first.  There are innumerable discussions on best web and application
frameworks, so probably not worth getting into too much.  In my case
I'm using a CherryPy/Genshi/SQLAlchemy/psycopg2 stack.

As long as you still have Access around, you'll have to take it into
consideration with schema changes, but that's not really that much
harder than any other schema migration management.  It's just another
client to the database you can run in parallel as long as you wish.
If you do change the schema, when done, just load your master Access
database, update the links, and rebuild/redistribute the installer to
your users.  Many changes (e.g., new columns with defaults) can be
backwards compatible and avoid forced upgrades.

You can operate both systems in parallel for a while even for similar
functionality (for testing if nothing else), but can then retire
functionality from Access as the web app supports it.  Ideally this
will be organic by your users preferring the web.  Selecting when to
drop Access entirely c

Re: deepcopy questions

2012-11-27 Thread Steven D'Aprano
On Tue, 27 Nov 2012 15:59:38 -0800, lars van gemerden wrote:

> Hi,
> 
> I get a very strange result when using deepcopy. The following code:
> 
> def __deepcopy__(self, memo):
> independent = self.independent()
> if independent is self:
> out = type(self)()
> out.__dict__ = copy.deepcopy(self.__dict__, memo) 
> print self.__dict__
> print out.__dict__ #strange result
> return out
> else:
> return copy.deepcopy(independent, memo).find(self.id).take()
> 
> prints different results for self.__dict__ and out.__dict__:

What makes you think that this is a strange result? What result are you 
expecting?

> {'_active_': False, 'init': {}, '_id_': 0, '_items_':
> [], '_name_': 'main'}
> {'_active_': False, 'init': {}, '_id_': 0}
> 
> Two items are missing in the copy. Maybe i am missing something obvious,
> but i cannot figure out how this could happen.
> 
> Can anyone tell me how this is possible?

The most obvious guess is that the memo dict already contains _items_ and 
_names_, and so they get skipped.

Please ensure your sample code can be run. You should create the simplest 
example of stand-alone code that other people can run. See more 
information here:

http://sscce.org/


By the way, is it just me or is the documentation for deepcopy seriously 
lacking? http://docs.python.org/3/library/copy.html

There's no mention of the additional arguments memo and _nil, and while 
the docs say to pass the memo dictionary to __deepcopy__ it doesn't 
document any restrictions on this memo, how to initialise it, or under 
what circumstances you would pass anything but an empty dict.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: deepcopy questions

2012-11-27 Thread MRAB

On 2012-11-27 23:59, lars van gemerden wrote:

Hi,

I get a very strange result when using deepcopy. The following code:

 def __deepcopy__(self, memo):
 independent = self.independent()
 if independent is self:
 out = type(self)()
 out.__dict__ = copy.deepcopy(self.__dict__, memo)
 print self.__dict__
 print out.__dict__ #strange result
 return out
 else:
 return copy.deepcopy(independent, memo).find(self.id).take()

prints different results for self.__dict__ and out.__dict__:

{'_active_': False, 'init': {}, '_id_': 0, '_items_': [], '_name_': 'main'}
{'_active_': False, 'init': {}, '_id_': 0}

Two items are missing in the copy. Maybe i am missing something obvious, but i 
cannot figure out how this could happen.

Can anyone tell me how this is possible?


I haven't been able to reproduce the problem.

Could you provide a self-contained and _runnable_ piece of code that
shows the problem?
--
http://mail.python.org/mailman/listinfo/python-list


please help me to debud my local chat network program

2012-11-27 Thread Minh Dang
Hello everybody, i am doing my project: local network chat using python
here is my file
http://www.mediafire.com/?cc2g9tmsju0ba2m
when i compile client.py, there is some bug
Traceback (most recent call last):
File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 303, in 

sys.exit(main())
File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 42, in 
main
servIP = broadcast()
File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 79, in 
broadcast
udpSock.bind((broadcastIP, broadcastPort))
OSError: [WinError 10049] The requested address is not valid in its context
Please help me to debud it, thank so much.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Migrate from Access 2010 / VBA

2012-11-27 Thread Michael Torrie
On 11/27/2012 05:06 PM, David Bolen wrote:
> I went through a very similar transition a few years ago from
> standalone Access databases (with GUI forms, queries and reports, as
> well as replication) to a pure web application with full reporting
> (albeit centrally designed and not a report designer for users).
> 
> I suppose my best overall suggestion is to migrate the data first and
> independently of any other activities.  
> 
> Having done this, you are then free to start implementing, for
> example, a web based application to start taking over functionality.

Very informative post, David.  This is the only practical way forward,
and had I not been away from the field so long (been a couple of years
since I was in such a position of doing this professionally), I would
have remembered this!

MS Access is a very powerful tool; it just has a lousy default database
engine.  ODBC isn't a perfect interface, but Access does speak it, and
so does a real DBM like PostgreSQL.

There are a number of tools out there for converting an access database
to SQL schema (if you don't have access to the schema).  I used it on a
commercial program once to check on their database parameters (shudder
using mdb in a production program!), and actually had a script to sync
it to read from it via ODBC and push it to a MySQL database.

All this reminds me of a project I wanted to do, but hit a road block.
My problem was I had a proprietary binary app, with an MDB data file (in
the program directory no less). I'd like to share it across users,
without worrying about corrupting the database, or even have a web front
end.  If I could set it up as David suggests with some kind of live
mirroring, and so that the program didn't know it was a database server
it was talking to, that would be good.  But I had no control over the
ODBC parameters (they were hard coded in the program).  Would have loved
to have separated out the access database part from the rest of the
program though.  I could then graft on a web front end.

thanks again for the post, David.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: please help me to debud my local chat network program

2012-11-27 Thread Terry Reedy

On 11/27/2012 9:50 PM, Minh Dang wrote:

Hello everybody, i am doing my project: local network chat using python
here is my file
http://www.mediafire.com/?cc2g9tmsju0ba2m


I am not familiar with .rar files and whether I can open them. Better to 
upload a standard .zip.



when i compile client.py, there is some bug
Traceback (most recent call last):
File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 303, in 

sys.exit(main())


sys.exit is not usually necessary. Just 'main()' should be sufficient.


File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 42, in 
main
servIP = broadcast()
File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 79, in 
broadcast
udpSock.bind((broadcastIP, broadcastPort))
OSError: [WinError 10049] The requested address is not valid in its context


The broadcastIP, which you defined elsewhere, whatever it is, is not 
valid for udpSock, also defined elsewhere.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: please help me to debud my local chat network program

2012-11-27 Thread Chris Angelico
On Wed, Nov 28, 2012 at 1:50 PM, Minh Dang  wrote:
> Hello everybody, i am doing my project: local network chat using python
> here is my file
> http://www.mediafire.com/?cc2g9tmsju0ba2m

Hmm. Might I recommend some other means of sharing your code? The
unrar-free utility from the Debian repo won't extract more than the
first file (accounts.txt), and I don't know if that's a problem with
unrar-free or your file. A better-known format like zip or tar.gz
would make things easier.

> when i compile client.py, there is some bug
> Traceback (most recent call last):
> File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 303, 
> in 
> sys.exit(main())
> File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 42, in 
> main
> servIP = broadcast()
> File "C:\Users\MINH_IT\workspace\project\src\project\pclient.py", line 79, in 
> broadcast
> udpSock.bind((broadcastIP, broadcastPort))
> OSError: [WinError 10049] The requested address is not valid in its context
> Please help me to debud it, thank so much.

What's the broadcastIP address you're using? (As mentioned above, I
can't see your source code.) Is it the appropriate address for one of
your interfaces?

Broadcast UDP is a bit tricky sometimes. You need to explicitly enable
broadcasting on the socket -  I've not done this in Python but two
seconds with Google suggests that this is needed:

udpSock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

You may have already done this, but I don't know without seeing your code.

My crystal ball tells me that you're trying to bind to a broadcast
address (eg 192.168.0.255). This is incorrect; you need to instead
bind to your own IP address (eg 192.168.0.17). You can probably just
do this:

udpSock.bind(('', broadcastPort))

However, my crystal ball has been playing up a bit lately, so it's
hard to be sure.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


"non central" package management

2012-11-27 Thread Miki Tebeka
Greetings,

The usual package mangers (easy_install, pip ...) install packages in one 
central location.

I'm looking for a solution that will allow every project (which run on the same 
machine) use it's own packages and versions of packages. (Context - we're 
running several applications on the same machine, and can't test *everything* 
when we update a package. Also these applications might ship to other machines 
to run - via hadoop streaming).

I can see two options:
1. Use a different virtual env for every package (and will need activate the 
right one for every package).
2. Have a "lib" directory in each application with versioned packages (we use 
something like that with svn:externals for version management).
3. Write my own package manager.

Anyone had the same problem? Any known solutions?

Thanks,
--
Miki
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "non central" package management

2012-11-27 Thread Roy Smith
In article <[email protected]>,
 Miki Tebeka  wrote:

> Greetings,
> 
> The usual package mangers (easy_install, pip ...) install packages in one 
> central location.
> 
> I'm looking for a solution that will allow every project (which run on the 
> same machine) use it's own packages and versions of packages. (Context - 
> we're running several applications on the same machine, and can't test 
> *everything* when we update a package. Also these applications might ship to 
> other machines to run - via hadoop streaming).

You want virtualenv.  Use pip to install packages, and they'll go into 
your (per-project) virtualenv.

> 2. Have a "lib" directory in each application with versioned packages (we use 
> something like that with svn:externals for version management).

What we do is run "pip freeze > requirements.txt" and check that into 
version control.  When we deploy, we create a new virtualenv, then do 
"pip install -r requirements.txt".

For hadoop jobs that we run on EMR under mrjob, we have the virtualenv 
setup in the bootstrap script.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "non central" package management

2012-11-27 Thread Miki Tebeka
On Tuesday, November 27, 2012 8:21:48 PM UTC-8, Roy Smith wrote:
> What we do is run "pip freeze > requirements.txt" and check that into 
> version control.
That's the idea I was toying with, thanks for confirming.

>  When we deploy, we create a new virtualenv, then do  
> "pip install -r requirements.txt".
1. Do you do that for every run?
2. Our ops team don't like to depend on pypi, they want internal repo - but I 
guess I can do that with "pip install -f".

Thanks,
--
Miki
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "non central" package management

2012-11-27 Thread Roy Smith
In article ,
 Miki Tebeka  wrote:

> >  When we deploy, we create a new virtualenv, then do  
> > "pip install -r requirements.txt".
> 1. Do you do that for every run?

Well, sort of.

We are currently using a single virtualenv per deployment host.  Each 
time we deploy new code, we checkout all the code into a fresh 
directory, but each of those shares a common virtualenv.  As part of the 
deploy process, we do indeed execute "pip install -r requirements.txt", 
which picks up any new required packages.

Unfortunately, that process doesn't give us a good way to back out a bad 
update.  It's easy for us to revert to an previous version of our code, 
but we don't have a good way to revert the virtualenv to its previous 
state.  Fortunately, that's been mostly a theoretical issue for us so 
far.

In the future, the plan is to build a complete fresh virtualenv for 
every deployment.  But we're not there yet.

> 2. Our ops team don't like to depend on pypi, they want internal repo - but I 
> guess I can do that with "pip install -f".

Listen to your ops team.  Right now, we install out of pypi, but that's 
slow, and on occasion, fails.  This is part of why we still use a shared 
virtualenv, and what your ops guys are trying to avoid :-)

Eventually, we'll mirror all the packages we need locally, and pip 
install out of that.  Once we've got that all working, we'll move to a 
new virtualenv per deployment (which sometimes is several times a day).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: please help me to debud my local chat network program

2012-11-27 Thread Minh Dang
ok, here is my code, zip
http://www.mediafire.com/?ob4kokda81fj6xc
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: please help me to debud my local chat network program

2012-11-27 Thread Chris Angelico
On Wed, Nov 28, 2012 at 4:47 PM, Minh Dang  wrote:
> ok, here is my code, zip
> http://www.mediafire.com/?ob4kokda81fj6xc

Thanks! That's a distinct improvement :)

That code doesn't exactly match the traceback, though; there's
client.py not pclient.py and the line numbers don't match. So I have
to just guess that the error is the same. However, I can see an
immediate problem.

def broadcast():
broadcastIP = ""
broadcastPort = 

That's not a valid broadcast IP :)

I think you probably want to bind to "" (aka "any address").

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to create an executable from python script in windows

2012-11-27 Thread Steven D'Aprano
On Tue, 27 Nov 2012 22:32:53 -0800, Prakash wrote:

> I had created a python script which actually uses pywin32 com. It opens
> few excel files and process it and produce output. Whenever I try to
> create an windows exe file usin py2exe it diplays error. Please guide me
> I am a noob in creating windows executable. Thanks in advance


Would you like us to guess what the error is? I love guessing games!

My guess is... "File not found". You need to give the right name for the 
file. Am I close?

If my guess was wrong, you need to tell us what the error is.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to create an executable from python script in windows

2012-11-27 Thread Prakash
It says like 

*** copy extensions ***
*** copy dlls ***
copying C:\Python24\lib\site-packages\py2exe\run_w.exe -> C:\Program Files 
(x86)\Notepad++\dist\build-check-test.exe
Adding python24.dll as resource to C:\Program Files 
(x86)\Notepad++\dist\build-check-test.exe
The following modules appear to be missing
['win32com.shell']

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   ole32.dll - C:\Windows\system32\ole32.dll
   OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
   USER32.dll - C:\Windows\system32\USER32.dll
   IMM32.dll - C:\Windows\system32\IMM32.dll
   SHELL32.dll - C:\Windows\system32\SHELL32.dll
   ntdll.dll - C:\Windows\system32\ntdll.dll
   comdlg32.dll - C:\Windows\system32\comdlg32.dll
   COMCTL32.dll - C:\Windows\system32\COMCTL32.dll
   ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
   MFC71.DLL - C:\Python24\lib\site-packages\Pythonwin\MFC71.DLL
   msvcrt.dll - C:\Windows\system32\msvcrt.dll
   WINSPOOL.DRV - C:\Windows\system32\WINSPOOL.DRV
   GDI32.dll - C:\Windows\system32\GDI32.dll
   VERSION.dll - C:\Windows\system32\VERSION.dll
   KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
   SETUPAPI.dll - C:\Windows\system32\SETUPAPI.dll
   KERNELBASE.dll - C:\Windows\system32\KERNELBASE.dll
   RPCRT4.dll - C:\Windows\system32\RPCRT4.dll
-- 
http://mail.python.org/mailman/listinfo/python-list