Re: PyWart: Import resolution order

2013-01-10 Thread Chris Angelico
On Fri, Jan 11, 2013 at 5:13 PM, Rick Johnson wrote: > The fact that Python looks in the stdlib _first_ is not a good idea. It would > seem more intuitive for a custom "math" module (living in the current > directory) to /override/ the stlib "math" module. The proper order is as > follows: > >

PyWart: Import resolution order

2013-01-10 Thread Rick Johnson
Python's import resolution order is terrible.[1] The fact that Python looks in the stdlib _first_ is not a good idea. It would seem more intuitive for a custom "math" module (living in the current directory) to /override/ the stlib "math" module. The proper order is as follows: 1. Current pac

PyWart: Module access syntax

2013-01-10 Thread Rick Johnson
Python's module/package access uses dot notation. mod1.mod2.mod3.modN Like many warts of the language, this wart is not so apparent when first learning the language. The dot seems innocently sufficient, however, in truth it is woefully inadequate! Observe: name1.name2.name3.name4.name5 C

Re: How to change colors of multiple widgets after hovering in Tkinter

2013-01-10 Thread Rick Johnson
On Thursday, January 10, 2013 1:13:38 PM UTC-6, Peter Otten wrote: > mountdoom wrote: > > I´m trying to make a script, which will change the background and > > foreground color of widgets after hovering. Peter's advice is spot on except you may want ALL widgets to change colors on and events. I

Re: Over 30 types of variables available in python ?

2013-01-10 Thread Rick Johnson
> On 1-7-2013 2:53:26 AM UTC-6, chaouche yacine wrote: > > Thanks for all your comments. It appears to me that there > is a slight confusion between types and classes then, plus > other entities (protocols ?) The only "confusion" stems from improper terminology. "Class" is the worst possible wor

Re: RIse and fall of languages in 2012

2013-01-10 Thread Craig Yoshioka
At one point or another I'm pretty sure I've googled "_ sucks" for every language I've ever used- even the ones I like. ie: Python easily more than once. Craig reporting from the road 10550 N Torrey Pines Rd La Jolla CA 92037 work: 858 784 9208 cell: 619 623 2233 On Jan 10, 2013, at 3:32 P

Re: How to modify this script?

2013-01-10 Thread Kurt Hansen
Kurt wrote: > > Spooky behavior. Yes, the green-apple-example also works for me with > your new script, BUT ...! > > Try to copy the table content on this page: > http://www.danacord.dk/frmsets/records/732-r.html > which is a realistic scenario. That's whar I am doing these days. > > Pasting it in

Re: Probabilistic unit tests?

2013-01-10 Thread Steven D'Aprano
On Thu, 10 Jan 2013 17:59:05 -0800, Nick Mellor wrote: > Hi, > > I've got a unit test that will usually succeed but sometimes fails. An > occasional failure is expected and fine. It's failing all the time I > want to test for. Well, that's not really a task for unit testing. Unit tests, like mos

Re: Probabilistic unit tests?

2013-01-10 Thread Roy Smith
In article , Nick Mellor wrote: > Hi, > > I've got a unit test that will usually succeed but sometimes fails. An > occasional failure is expected and fine. It's failing all the time I want to > test for. > > What I want to test is "on average, there are the same number of males and > female

Probabilistic unit tests?

2013-01-10 Thread Nick Mellor
Hi, I've got a unit test that will usually succeed but sometimes fails. An occasional failure is expected and fine. It's failing all the time I want to test for. What I want to test is "on average, there are the same number of males and females in a sample, give or take 2%." Here's the unit t

Re: RIse and fall of languages in 2012

2013-01-10 Thread Walter Hurry
On Thu, 10 Jan 2013 07:23:51 +, Steven D'Aprano wrote: > "In general-purpose scripting languages, Python continues to grow > slowly, JavaScript and Ruby are treading water, and Perl continues its > long decline. According to Google trends, the number of searches for > Perl is 19% of what it wa

Re: Why BOM in logging message?

2013-01-10 Thread Terry Reedy
On 1/10/2013 11:06 AM, Roy Smith wrote: Well, this is fascinating. It turns out that while all of our machines report that they're running 2.7.3, they have two different versions of /usr/lib/python2.7/logging/handlers.py! -rw-r--r-- 1 root root 45076 Aug 1 05:39 /usr/lib/python2.7/logging/han

Re: RIse and fall of languages in 2012

2013-01-10 Thread Steven D'Aprano
On Thu, 10 Jan 2013 12:42:49 -0700, Michael Torrie wrote: >> And from the TIOBE Index, Python is steady at number 8: >> >> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html > > The TIOBE index is meaningless. Since it's based on google searches, > one could probably guess that an

Re: RIse and fall of languages in 2012

2013-01-10 Thread John Ladasky
On Wednesday, January 9, 2013 11:23:51 PM UTC-8, Steven D'Aprano wrote: > One should always be careful pronouncing a language dead or dying, No kidding! https://www.google.com/#q=is+fortran+still+used I usually use the query phrase "Why isn't Fortran dead yet?", but you get a better list of l

Re: average time calculation??

2013-01-10 Thread Ian Kelly
On Thu, Jan 10, 2013 at 1:31 PM, pmec wrote: > Hi Oscar, again I do apologize for my beginner mistakes, I've changed the > code taking in consideration some of your and MRAB suggestions. > > Could you give me an example on how could I use the datetime.timedelta > function in this particular case

Organic Chemistry, 8th Ed by Wade, Jan Simek

2013-01-10 Thread kalvinmanual
I have solutions manuals to all problems and exercises in these textbooks. To get one in an electronic format contact me at: kalvinmanual(at)gmail(dot)com and let me know its title, author and edition. Please this service is NOT free. instructor's solutions manual to OpenScape Voice V3.1R3 Test

Re: average time calculation??

2013-01-10 Thread pmec
Hi Oscar, again I do apologize for my beginner mistakes, I've changed the code taking in consideration some of your and MRAB suggestions. Could you give me an example on how could I use the datetime.timedelta function in this particular case. This is my code: def lap_average(lap1, lap2):

Re: average time calculation??

2013-01-10 Thread pmec
Hi Oscar, Thank you for your reply, and you are absolutely right, I meant hundredths of a second to be outputed -- http://mail.python.org/mailman/listinfo/python-list

Re: RIse and fall of languages in 2012

2013-01-10 Thread Michael Torrie
On 01/10/2013 12:23 AM, Steven D'Aprano wrote: > "In general-purpose scripting languages, Python continues to grow slowly, > JavaScript and Ruby are treading water, and Perl continues its long > decline. According to Google trends, the number of searches for Perl is > 19% of what it was in 2004.

Re: How to change colors of multiple widgets after hovering in Tkinter

2013-01-10 Thread Peter Otten
mountdoo...@gmail.com wrote: > I´m trying to make a script, which will change the background and > foreground color of widgets after hovering. > but when I hover on any button, nothing happens, they stay white. I know I > could use a function, but there would be two functions for every widget (1

Re: [Tutor] How to run multiline shell command within python

2013-01-10 Thread Karim
On 10/01/2013 16:21, Matty Sarro wrote: Have you looked a the pexpect class? It works like gangbusters, especially if you're trying to run something with an interactive shell. http://www.noah.org/wiki/pexpect On Thu, Jan 10, 2013 at 9:25 AM, Karim > wrote: On

How to change colors of multiple widgets after hovering in Tkinter

2013-01-10 Thread mountdoom12
Hello, I´m trying to make a script, which will change the background and foreground color of widgets after hovering. - from Tkinter import * root=Tk() Hover1=Button(root,text="Red color", bg="white") Hover1.pack() Hover2=Button(root,text="Yellow color", bg="white") Ho

Re: average time calculation??

2013-01-10 Thread MRAB
On 2013-01-10 17:50, pmec wrote: Hi there guys i've got a script that's suppose to find the average of two times as strings. The times are in minutes:seconds:milliseconds i'm doing ok in printing the right minutes and seconds my problem is with the milliseconds. Example if i have 00:02:20 and

Re: average time calculation??

2013-01-10 Thread Oscar Benjamin
Two quick corrections to what I wrote... On 10 January 2013 18:13, Oscar Benjamin wrote: > On 10 January 2013 17:50, pmec wrote: >> Hi there guys i've got a script that's suppose to find the average of two >> times as strings. The times are in minutes:seconds:milliseconds >> i'm doing ok in pri

Re: average time calculation??

2013-01-10 Thread Oscar Benjamin
On 10 January 2013 17:50, pmec wrote: > Hi there guys i've got a script that's suppose to find the average of two > times as strings. The times are in minutes:seconds:milliseconds > i'm doing ok in printing the right minutes and seconds my problem is with the > milliseconds. You might find it e

average time calculation??

2013-01-10 Thread pmec
Hi there guys i've got a script that's suppose to find the average of two times as strings. The times are in minutes:seconds:milliseconds i'm doing ok in printing the right minutes and seconds my problem is with the milliseconds. Example if i have 00:02:20 and 00:04:40 the average will be 00:03:

Re: Why BOM in logging message?

2013-01-10 Thread Chris Angelico
On Fri, Jan 11, 2013 at 3:40 AM, Roy Smith wrote: >>On Fri, Jan 11, 2013 at 3:06 AM, Roy Smith wrote: >>> -rw-r--r-- 1 root root 45076 Aug 1 05:39 >>> /usr/lib/python2.7/logging/handlers.py >>> -rw-r--r-- 1 root root 45143 Apr 20 2012 >>> /usr/lib/python2.7/logging/handlers.py > > Chris Angel

Re: Why BOM in logging message?

2013-01-10 Thread Roy Smith
>On Fri, Jan 11, 2013 at 3:06 AM, Roy Smith wrote: >> -rw-r--r-- 1 root root 45076 Aug 1 05:39 >> /usr/lib/python2.7/logging/handlers.py >> -rw-r--r-- 1 root root 45143 Apr 20 2012 >> /usr/lib/python2.7/logging/handlers.py Chris Angelico wrote: >$ dpkg -S /usr/lib/python2.7/logging/handlers

problems importing from /usr/lib/pyshared/

2013-01-10 Thread Harold
Dear all, I recently upgraded my system from ubuntu 11.4 to 12.4 and since run into an issue when trying to import several packages in python2.7, e.g. harold@ubuntu:~$ python -c 'import gtk' Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/dist-packages/gtk-2.

Re: Why BOM in logging message?

2013-01-10 Thread Chris Angelico
On Fri, Jan 11, 2013 at 3:06 AM, Roy Smith wrote: > Well, this is fascinating. It turns out that while all of our > machines report that they're running 2.7.3, they have two different > versions of /usr/lib/python2.7/logging/handlers.py! > > -rw-r--r-- 1 root root 45076 Aug 1 05:39 > /usr/lib/p

Re: Why BOM in logging message?

2013-01-10 Thread Roy Smith
In article , Roy Smith wrote: >In article , > Chris Angelico wrote: > >> On Thu, Jan 10, 2013 at 9:54 AM, Roy Smith wrote: >> > What's weird is that two of the servers, and only those two, stick a >> > BOM (Byte Order Mark) in front of the message they log. >> >> Could it be this issue you're

Re: [Tutor] How to run multiline shell command within python

2013-01-10 Thread Matty Sarro
Have you looked a the pexpect class? It works like gangbusters, especially if you're trying to run something with an interactive shell. http://www.noah.org/wiki/pexpect On Thu, Jan 10, 2013 at 9:25 AM, Karim wrote: > On 10/01/2013 09:31, Hugo Arts wrote: > > On Thu, Jan 10, 2013 at 7:01 AM, K

Re: Python-list Digest, Vol 112, Issue 79

2013-01-10 Thread Niklas Berliner
> > > > > -- Weitergeleitete Nachricht -- > From: Dave Angel > To: python-list@python.org > Cc: > Date: Thu, 10 Jan 2013 00:56:20 -0500 > Subject: Re: subprocess.Popen and multiprocessing fails to execute > external program > On 01/09/2013 11:08 PM, Niklas Berliner wrote: > > I hav

Re: [Tutor] How to run multiline shell command within python

2013-01-10 Thread Karim
On 10/01/2013 09:31, Hugo Arts wrote: On Thu, Jan 10, 2013 at 7:01 AM, Karim > wrote: Hello all, I want to run multiline shell command within python without using a command file but directly execute several lines of shell. I already use *subprocess.c

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2013-01-10 Thread 88888 Dihedral
在 2013年1月10日星期四UTC+8下午7时34分23秒,Duncan Booth写道: > Dave Cinege wrote: > > > > > You will notice that the code is disgusting simple. However I have > > > found that this has completely changed the way I program in python. > > > I've re-written some exiting programs using Thesaurus, and often >

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2013-01-10 Thread Duncan Booth
Dave Cinege wrote: > You will notice that the code is disgusting simple. However I have > found that this has completely changed the way I program in python. > I've re-written some exiting programs using Thesaurus, and often > relized 15-30% code reduction. Additionally I find the new code much >

Re: PIL or something to open EXIF Metadata with Python

2013-01-10 Thread Pete Forman
Tim Golden writes: > On 09/01/2013 14:45, Jose Trevino wrote: >> I am trying to load the PIL module to manage exif metadata with >> Python but have had no success. > > > Try pyexiv2: > > http://tilloy.net/dev/pyexiv2/ > > TJG Or Hachoir http://pypi.python.org/pypi/hachoir-metadata https://bi

Re: [Tutor] How to run multiline shell command within python

2013-01-10 Thread Hugo Arts
On Thu, Jan 10, 2013 at 7:01 AM, Karim wrote: > > > Hello all, > > I want to run multiline shell command within python without using a > command file but directly execute several lines of shell. > I already use *subprocess.checkoutput("csh -f my_file.csh".split())* but I > want to know if it is p