Re: PyWart: Module access syntax

2013-01-15 Thread Chris Angelico
On Tue, Jan 15, 2013 at 6:49 PM, Rick Johnson wrote: > Look, maybe nobody has the time to deal with this module, so if you need some > help, then feel free to ask for my assistance. All Guido has to do is send me > a private email and say: > > """ Hello Rick! Your ideas for packaging of Tkinter

Re: unit selection problem

2013-01-15 Thread Ulrich Eckhardt
Am 14.01.2013 21:29, schrieb Paul Pittlerson: map_textures = get_sprites( (48, 48) ,"spritesheet.png" , (0, 0) ) You forgot to include spritesheet.png in your message. Seriously, condense your code down to a minimal example. This might help you finding the problem yourself, otherwise

Re: PyWart (Terminolgy): "Class"

2013-01-15 Thread alex23
On Jan 15, 1:28 pm, "D'Arcy J.M. Cain" wrote: > Steven D'Aprano wrote: > > I disagree that Rick is a troll. Trolling requires that the troll > > Doesn't matter.  He duck types as one. +1 Intent isn't magic. If Rick intends to contribute, he could actually contribute. -- http://mail.python.org/

Re: PyWart (Terminolgy): "Class"

2013-01-15 Thread Steven D'Aprano
On Mon, 14 Jan 2013 22:54:10 -0800, Rick Johnson wrote: > No, classes DO NOT exist at runtime OR compile time! Classes are only > *structured text* (or code if you prefer) that instruct Python to build > *real* MEMORY OBJECTS for us. The "magic" that you are witnessing is > Python, not classes. U

[ANN] Data Plotting Library DISLIN 10.3

2013-01-15 Thread Helmut Michels
Dear Python users, I am pleased to announce version 10.3 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as

interrupt the file sending if the file size over the quota...some errors here...

2013-01-15 Thread Levi Nie
i want to interrupt the file sending. but i can't change the client. so i need change the server. All things go well, but the message i wanna response seem not work. is the self.transport.loseConnection() (the last line) blocking the messages? in fact, i work on Cumulus(nimbus project) which based

atexit handler in IDLE?

2013-01-15 Thread Steve Spicklemire
Hello Pythonistas! I'm trying to get this program, which works on the command line, to run correctly in the IDLE environment: import atexit print "This is my program" def exit_func(): print "OK.. that's all folks!" atexit.register(exit_func) print "Program is ending..." When I run this

Re: interrupt the file sending if the file size over the quota...some errors here...

2013-01-15 Thread Ulrich Eckhardt
Am 15.01.2013 10:46, schrieb Levi Nie: i want to interrupt the file sending. but i can't change the client. so i need change the server. All things go well, but the message i wanna response seem not work. Ahem, what? It doesn't work, so does it sit on the couch all day? is the self.transport

Re: Thought of the day

2013-01-15 Thread Dave Angel
On 01/14/2013 09:18 AM, Chris Angelico wrote: > On Tue, Jan 15, 2013 at 1:15 AM, Tim Chase > wrote: >> A newbie programmer had a problem and thought >> >> >> >> "I'll solve it by posting on >> >> >> >> python-list@python.org and on Google Groups". >> >> >> >> And now we have the problem of two thr

Re: PyWart: Module access syntax

2013-01-15 Thread Jean-Michel Pichavant
> > Please explain how this is a problem. As Steven said, there is NO > > > > useful difference. I don't *care* whether it's a package, a module, > > or > > > > whatever. Module with class with static member? Fine. Package with > > > > module with class? Also fine. Imported special object that u

i can't understand decorator

2013-01-15 Thread contro opinion
>>> def deco(func): ... def kdeco(): ... print("before myfunc() called.") ... func() ... print(" after myfunc() called.") ... return kdeco ... >>> @deco ... def myfunc(): ... print(" myfunc() called.") ... >>> myfunc() before myfunc() called. myfunc() cal

Re: Compiling native extensions with Visual Studio 2012?

2013-01-15 Thread Christian Heimes
Am 12.01.2013 17:06, schrieb Alec Taylor: > Would be awesome to get these built into stdlib. > > Compiling my own versions mostly for virtualenv purposes; though > sometimes I can't find the binary on: > http://www.lfd.uci.edu/~gohlke/pythonlibs/ Let's see. I've 10 months to work on the PEP + imp

Re: i can't understand decorator

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 14:20, contro opinion wrote: def deco(func): > ... def kdeco(): > ... print("before myfunc() called.") > ... func() > ... print(" after myfunc() called.") > ... return kdeco > ... @deco > ... def myfunc(): > ... print(" myfunc

Re: sqlite3 puzzle

2013-01-15 Thread Rob Day
On 15 January 2013 07:09, llanitedave wrote: > So I put the following test code in my initialization method: > > # open database file > self.geologger_db = sqlite3.connect('geologger.mgc') > self.db_cursor = self.geologger_db.cursor() > self.foreign_key_status = self.db_cursor.exe

Re: sqlite3 puzzle

2013-01-15 Thread llanitedave
On Tuesday, January 15, 2013 6:36:51 AM UTC-8, Rob Day wrote: > On 15 January 2013 07:09, llanitedave wrote: > > > > > So I put the following test code in my initialization method: > > > > > > # open database file > > > self.geologger_db = sqlite3.connect('geologger.mgc') > > >

Re: Thought of the day

2013-01-15 Thread Antoine Pitrou
Steven D'Aprano pearwood.info> writes: > > A programmer had a problem, and thought Now he has "I know, I'll solve > two it with threads!" problems. Host: Last week the Royal Festival Hall saw the first performance of a new logfile by one of the world's leading modern programmers, Steven "Two t

Re: Thought of the day

2013-01-15 Thread Tim Golden
On 15/01/2013 16:48, Antoine Pitrou wrote: > Steven D'Aprano pearwood.info> writes: >> >> A programmer had a problem, and thought Now he has "I know, I'll solve >> two it with threads!" problems. > > > Host: Last week the Royal Festival Hall saw the first performance of a new > logfile by one o

Re: sqlite3 puzzle

2013-01-15 Thread Rob Day
On 15 January 2013 15:51, llanitedave wrote: > Thanks for the suggestion, Rob, but that didn't make any difference. I've > never had an issue with putting the execute object into a variable and > calling "fetch" on that variable. > > I can accept reality if it turns out that foreign keys simply

atexit handler in IDLE?

2013-01-15 Thread Mark Janssen
On Tue, Jan 15, 2013 at 6:25 AM, Steve Spicklemire wrote: > I'm trying to get this program, which works on the command line, to run > correctly in the IDLE environment: > > import atexit > > print "This is my program" > > def exit_func(): > print "OK.. that's all folks!" > > atexit.register(e

Re: sqlite3 puzzle

2013-01-15 Thread inq1ltd
On Monday, January 14, 2013 11:09:28 PM llanitedave wrote: > I'm trying to get an application working in Python 2.7 and wx.Python which > contains an embedded sqlite3 file. There are a few tables with foreign > keys defined. In looking at the sqlite3 documentation, it says > > "Assuming the libr

Re: Question on for loop

2013-01-15 Thread subhabangalore
On Friday, January 4, 2013 11:18:24 AM UTC+5:30, Steven D'Aprano wrote: > On Thu, 03 Jan 2013 12:04:03 -0800, subhabangalore wrote: > > > > > Dear Group, > > > If I take a list like the following: > > > > > > fruits = ['banana', 'apple', 'mango'] > > > for fruit in fruits: > > >print

Re: atexit handler in IDLE?

2013-01-15 Thread Steve Spicklemire
On Jan 15, 2013, at 10:22 AM, Mark Janssen wrote: > On Tue, Jan 15, 2013 at 6:25 AM, Steve Spicklemire wrote: >> I'm trying to get this program, which works on the command line, to run >> correctly in the IDLE environment: >> >> import atexit >> >> print "This is my program" >> >> def exit_

Re: Thought of the day

2013-01-15 Thread Chris Angelico
On Wed, Jan 16, 2013 at 3:48 AM, Antoine Pitrou wrote: > D'Aprano: No, no. Look. This thread business -- it doesn't really matter. > The threads aren't important. A few friends call me Two Threads and that's > all there is to it. I wish you'd ask me about the logfile. Everybody talks > about the t

Re: sqlite3 puzzle

2013-01-15 Thread llanitedave
On Tuesday, January 15, 2013 9:13:13 AM UTC-8, Rob Day wrote: > On 15 January 2013 15:51, llanitedave wrote: > > > Thanks for the suggestion, Rob, but that didn't make any difference. I've > > never had an issue with putting the execute object into a variable and > > calling "fetch" on that va

Re: i can't understand decorator

2013-01-15 Thread Thomas Rachel
Am 15.01.2013 15:20 schrieb contro opinion: >>> def deco(func): ... def kdeco(): ... print("before myfunc() called.") ... func() ... print(" after myfunc() called.") ... return kdeco ... >>> @deco ... def myfunc(): ... print(" myfunc() called.") ...

Re: sqlite3 puzzle

2013-01-15 Thread Rob Day
Glad I could help! Using a local source control system like git, bzr or hg is really useful in situations like these - it's far, far easier to debug issues of the form "I made changes and now it's broken" when you can do `git diff yesterday's-version today's-version` and see exactly what the chan

Re: sqlite3 puzzle

2013-01-15 Thread llanitedave
Yabut I'm talking about changes I'd made 30 seconds before to code I'd written 5 minutes before. My short-term memory is nothing to write home about, even if I could remember my mailing address! On Tuesday, January 15, 2013 2:27:28 PM UTC-8, Rob Day wrote: > Glad I could help! > > > > > >

Re: Thought of the day

2013-01-15 Thread DJC
On 15/01/13 16:48, Antoine Pitrou wrote: Steven D'Aprano pearwood.info> writes: A programmer had a problem, and thought Now he has "I know, I'll solve two it with threads!" problems. Host: Last week the Royal Festival Hall saw the first performance of a new logfile by one of the world's lea

Is there a more elegant way to handle determing fail status?

2013-01-15 Thread J
Ok, so I have a diagnostic tool, written by someone else. That tool runs a series of small tests defined by the user and can simplified summary output that can be one of the following: FAILED_CRITICAL FAILED_HIGH FAILED_MEDIUM FAILED_LOW PASSED I also have a wrapper script I wrote to run these te

Re: Is there a more elegant way to handle determing fail status?

2013-01-15 Thread donarb
On Tuesday, January 15, 2013 3:24:44 PM UTC-8, J wrote: > Ok, so I have a diagnostic tool, written by someone else. That tool > > runs a series of small tests defined by the user and can simplified > > summary output that can be one of the following: > > > > FAILED_CRITICAL > > FAILED_HIGH >

Re: Is there a more elegant way to handle determing fail status?

2013-01-15 Thread Oscar Benjamin
On 15 January 2013 23:24, J wrote: > Ok, so I have a diagnostic tool, written by someone else. That tool > runs a series of small tests defined by the user and can simplified > summary output that can be one of the following: > > FAILED_CRITICAL > FAILED_HIGH > FAILED_MEDIUM > FAILED_LOW > PASSED

Re: Is there a more elegant way to handle determing fail status?

2013-01-15 Thread Ian Kelly
On Tue, Jan 15, 2013 at 4:24 PM, J wrote: > The exit code determination above works, but it just feels inelegant. > It feels like there's a better way of implementing that, but I can't > come up with one that still honors the fail level properly (e.g. other > solutions will fail on medium, but won

Please help test Pillow for Python 3

2013-01-15 Thread Alex Clark
Hi, Python 3 support for PIL has been merged into the Pillow (PIL fork) master branch. If this interests you, please help test! - git://github.com/python-imaging/Pillow.git More on the subject: - http://blog.aclark.net/2013/01/10/pillow-python-3/ -- Alex Clark · https://www.gittip.com/aclar

Re: atexit handler in IDLE?

2013-01-15 Thread Terry Reedy
On 1/15/2013 7:25 AM, Steve Spicklemire wrote: import atexit print "This is my program" def exit_func(): print "OK.. that's all folks!" atexit.register(exit_func) print "Program is ending..." If you put () around the strings, it will run the same *and* work in 3.x. When I run this on

Re: Is there a more elegant way to handle determing fail status?

2013-01-15 Thread Steven D'Aprano
On Tue, 15 Jan 2013 18:24:44 -0500, J wrote: > The problem is that my exit determination looks like this: > > if fail_priority == fail_levels['FAILED_CRITICAL']: > if critical_fails: > return 1 > if fail_priority == fail_levels['FAILED_HIGH']: > if critical_fa

Re: cymbalic reference?

2013-01-15 Thread Chris Angelico
On Wed, Jan 16, 2013 at 3:56 PM, rh wrote: > While I'm at it what magic could I use to print "the-class-I-am-in good" > instead of hard-coding "Abc good"? I tried __class_ and self.__class__ Almost there! Try self.__class__.__name__ to get the name as a string. ChrisA -- http://mail.python.org/

Re: cymbalic reference?

2013-01-15 Thread Benjamin Kaplan
On Tue, Jan 15, 2013 at 8:56 PM, rh wrote: > I have this working and I am curious to know how others do same. > > class Abc(object): > def __init__(self): > pass > def good(self): > print "Abc good" > def better(self): > print "Abc better" > > urls = {'Abc':'htt

Re: cymbalic reference?

2013-01-15 Thread Terry Reedy
On 1/15/2013 11:56 PM, rh wrote: I have this working and I am curious to know how others do same. class Abc(object): def __init__(self): pass def good(self): print "Abc good" def better(self): print "Abc better" urls = {'Abc':'http://example.com'} strin

PyWart: Exception error paths far too verbose

2013-01-15 Thread Rick Johnson
Python needs to trim the path to the source file from which the exception was caught and only display the relative path starting from your personal library folder. For example. Say your personal library exists in: C:\users\user\documents\python\lib ...then there is no need to post THAT por