Re: Which non SQL Database ?

2010-12-05 Thread Steve Holden
On 12/5/2010 12:59 AM, CM wrote: > SQlite itself is around 300 kilobytes. That's negligible. It is also > already in Python, so you'd have to purposefully exclude it in > creating your executable to save those 300 kb and thus the 1/13th of a > second additional time it would take average (3.9 MB/

Re: class attribute confusion

2010-12-05 Thread Steve Holden
On 12/3/2010 11:58 PM, Steven D'Aprano wrote: > Right. If you define a *class* attribute, it lives in the class, not the > instance, and so all instances share the same value. Unless, of course, an instance binds the same name in its namespace, in which case it will (usually) mask the class attri

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread Steven D'Aprano
On Mon, 06 Dec 2010 06:15:06 +, Tim Harig wrote: >> But isn't explicit string literal concatenation better than implicit >> string literal concatenation? > > So add the "+", it really doesn't change it much. Perhaps not *much*, but it *may* change it a bit. Implicit concatenation of literal

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread Tim Harig
On 2010-12-06, Andreas Waldenburger wrote: > On Sun, 5 Dec 2010 19:52:54 -0800 Chris Rebert wrote: > >> On Sun, Dec 5, 2010 at 7:40 PM, shearichard >> wrote: >> > Hi - PEP8 says lines should not exceed 79 characters in length >> > ( http://www.python.org/dev/peps/pep-0008/ ). >> > >> > So if you

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread Andreas Waldenburger
On Sun, 5 Dec 2010 19:52:54 -0800 Chris Rebert wrote: > On Sun, Dec 5, 2010 at 7:40 PM, shearichard > wrote: > > Hi - PEP8 says lines should not exceed 79 characters in length > > ( http://www.python.org/dev/peps/pep-0008/ ). > > > > So if you've got some code that looks like this : > > > > rais

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread Ben Finney
shearichard writes: > Hi - PEP8 says lines should not exceed 79 characters in length > ( http://www.python.org/dev/peps/pep-0008/ ). > > So if you've got some code that looks like this : > > raise fooMod.fooException("Some message which is quite long") PEP 8 also says those names are poorly chos

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-12-05 Thread Dan Stromberg
Ultimately I switched to reading the filenames from file descriptor 0 using os.read(); this gave back bytes in 3.x, strings of single-byte characters in 2.x - which are similar enough for my purposes, and eliminated the filesystem encoding(s) question nicely. I rewrote readline0 (http://stromberg.

Wanted: slow regexes

2010-12-05 Thread MRAB
I'm looking for examples of regexes which are slow (especially those which seem never to finish) but whose results are known. I already have those reported in the bug tracker, but further ones will be welcome. This is for testing additional modifications to the new regex implementation (available

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread MRAB
On 06/12/2010 03:40, shearichard wrote: Hi - PEP8 says lines should not exceed 79 characters in length ( http://www.python.org/dev/peps/pep-0008/ ). So if you've got some code that looks like this : raise fooMod.fooException("Some message which is quite long") ... and assuming a certain amount

Re: PEP8 compliance and exception messages ?

2010-12-05 Thread Chris Rebert
On Sun, Dec 5, 2010 at 7:40 PM, shearichard wrote: > Hi - PEP8 says lines should not exceed 79 characters in length > ( http://www.python.org/dev/peps/pep-0008/ ). > > So if you've got some code that looks like this : > > raise fooMod.fooException("Some message which is quite long") > > ... and as

PEP8 compliance and exception messages ?

2010-12-05 Thread shearichard
Hi - PEP8 says lines should not exceed 79 characters in length ( http://www.python.org/dev/peps/pep-0008/ ). So if you've got some code that looks like this : raise fooMod.fooException("Some message which is quite long") ... and assuming a certain amount of indenting you're going to break that g

Re: How do I get the email address of the person who clicked the link in the email?

2010-12-05 Thread alex23
On Dec 5, 10:15 am, Zeynel wrote: > I am working with Google App Engine python version. The app sends an > email to the user with a link to a page to upload an image as an > avatar. It would be nice to have the email so that I can associate the > avatar with that email. How can I do this? Thank yo

Re: Comparison with False - something I don't understand

2010-12-05 Thread MRAB
On 05/12/2010 21:01, Martin v. Loewis wrote: result = myfunction (vars) if not result: # error condition Now above I first realized that the function can also return an empty list under some conditions and so changed it to If your function returns a list when successful, it should not re

Re: Collision of rotated rectangles without pygame

2010-12-05 Thread Martin Manns
On Sun, 5 Dec 2010 23:49:36 +0100 Martin Manns wrote: > Is my replacement of the rectangle object wrong or is vizier not > working correctly with pygame as well? Answering my first question: Vizier works O.K. with pygame. I am unsure what I did wrong in the rect replacement though. Cheers Ma

Collision of rotated rectangles without pygame

2010-12-05 Thread Martin Manns
Hello, I am looking for a Python library for 2D collision checks of rotated rectangles. Currently, I have found vizier 0.5b that is based on pygame. Since I do not want to add a pygame dependency to my app, I replaced the pygame.rect.Rect by a wxPython wx.Rect (see code below). However, collisio

Re: Which non SQL Database ?

2010-12-05 Thread Dan Stromberg
On Sun, Dec 5, 2010 at 12:01 AM, John Nagle wrote: > On 12/4/2010 8:44 PM, Monte Milanuk wrote: >> >> On 12/4/10 3:43 PM, Jorge Biquez wrote: >> >>> I do not see a good reason for not using Sqlite3 BUT if for some reason >>> would not be an option what plain schema of files would you use? >> >

Re: Comparison with False - something I don't understand

2010-12-05 Thread Martin v. Loewis
> result = myfunction (vars) > > if not result: > # error condition > > Now above I first realized that the function can also return an empty > list under some conditions and so changed it to If your function returns a list when successful, it should not return False in the error case. Ins

Re: Which non SQL Database ?

2010-12-05 Thread Stef Mientki
On 04-12-2010 23:42, Jorge Biquez wrote: > Hello all. > > Newbie question. Sorry. > > As part of my process to learn python I am working on two personal > applications. Both will do it > fine with a simple structure of data stored in files. I now there are lot of > databases around I > can use bu

Re: Perceived inconsistency in py3k documentation

2010-12-05 Thread Terry Reedy
On 12/5/2010 3:31 AM, Greg wrote: For future reference, 1) At http://docs.python.org/py3k/reference/datamodel.html: 2) At http://docs.python.org/py3k/library/stdtypes.html: do not work because of the trailing :s, at least not with FireFox. > 1) At http://docs.python.org/py3k/reference/datamo

Re: How to add data into exisitng Excel file at next open row?

2010-12-05 Thread noydb
On Dec 5, 8:42 am, Steve Holden wrote: > On 12/3/2010 6:21 PM, noydb wrote: > > > > > > > How can you determine the next open row in an existing Excel file such > > that you can start adding data to the cells in that row?  As in below, > > I want a variable in place of the 6 (row 6 in the four ws1

Re: Framework design question

2010-12-05 Thread MRAB
On 05/12/2010 18:20, Alan Harris-Reid wrote: Hi, When committing data that has originally come from a webpage, sometimes data has to be converted to a data type or format which is suitable for the back-end database. For instance, a date in 'dd/mm/' format needs to be converted to a Python d

Framework design question

2010-12-05 Thread Alan Harris-Reid
Hi, When committing data that has originally come from a webpage, sometimes data has to be converted to a data type or format which is suitable for the back-end database. For instance, a date in 'dd/mm/' format needs to be converted to a Python date-object or '-mm-dd' in order to be

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-05 Thread small Pox
On Dec 4, 11:37 pm, Madhu wrote: > * jvt <5e1f79ab-5432-4f18-b896-362b7406c...@i18g2000yqn.googlegroups.com> : > Wrote on Sat, 4 Dec 2010 19:34:53 -0800 (PST): > > | > | I think this is correct: > | > | > | (defun unknown-function (sym0) > |   (let (sym1 sym2) > |       (while (or sym2 sym0) > |  

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-05 Thread small Pox
On Dec 5, 9:13 am, "rupertlssm...@googlemail.com" wrote: > On Dec 5, 3:34 am, jvt wrote: > > > I think this is correct: > > > (defun unknown-function (sym0) > >   (let (sym1 sym2) > >         (while (or sym2 sym0) > >           (if sym0 > >                   (if (consp sym0) > >                

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-05 Thread rupertlssm...@googlemail.com
On Dec 5, 3:34 am, jvt wrote: > On Dec 4, 4:49 pm, Barb Knox wrote: > > > > > > > In article > > <46365e1d-42d8-4b3b-8e69-941472467...@u25g2000pra.googlegroups.com>, > >  small Pox wrote: > > > > Rules : > > > No need to add any additional hurdles -- the code as presented is > > thoroughly unrea

Re: Which non SQL Database ?

2010-12-05 Thread Roy Smith
In article <4cfb802...@dnews.tpgi.com.au>, Lie Ryan wrote: > On 12/05/10 10:43, Jorge Biquez wrote: > > I do not see a good reason for not using Sqlite3 BUT if for some reason > > would not be an option what plain schema of files would you use? > > Assuming you don't want SQL, you can use

Re: How to add data into exisitng Excel file at next open row?

2010-12-05 Thread Steve Holden
On 12/3/2010 6:21 PM, noydb wrote: > How can you determine the next open row in an existing Excel file such > that you can start adding data to the cells in that row? As in below, > I want a variable in place of the 6 (row 6 in the four ws1.Cells(x,1) > lines), but have no other way of knowing wha

Re: Which non SQL Database ?

2010-12-05 Thread Tim Chase
On 12/05/2010 03:41 AM, Alan Gauld wrote: Why not use SQL? SQLlite comes with Python, is small, easy to use and if necessary can be used in-memory and as such fast. The only reason I could see using something other than sqlite3 for such a use-case would be if the OP has to support Python befo

Re: Comparison with False - something I don't understand

2010-12-05 Thread Tim Chase
On 12/04/2010 11:42 PM, Steven D'Aprano wrote: On Sun, 05 Dec 2010 04:13:02 +, Tim Harig wrote: str.find is more troublesome, because the sentinel -1 doesn't propagate and is a common source of errors: result = string[string.find(delim):] will return a plausible-looking but incorrect result

Re: Which non SQL Database ?

2010-12-05 Thread Lie Ryan
On 12/05/10 10:43, Jorge Biquez wrote: > I do not see a good reason for not using Sqlite3 BUT if for some reason > would not be an option what plain schema of files would you use? Assuming you don't want SQL, you can use filesystem-based database. Most people doesn't realize that a filesystem

Re: Comparison with False - something I don't understand

2010-12-05 Thread Tim Harig
On 2010-12-05, Tim Harig wrote: > On 2010-12-05, Paul Rubin wrote: >> Tim Harig writes: >>> The fact that I bothered to create classes for the dice and roles, rather >>> then simply iterating over a list of numbers, should tell you that I >>> produced was of a far more flexible nature; includin

Re: Comparison with False - something I don't understand

2010-12-05 Thread Tim Harig
On 2010-12-05, Paul Rubin wrote: > Tim Harig writes: >> The fact that I bothered to create classes for the dice and roles, rather >> then simply iterating over a list of numbers, should tell you that I >> produced was of a far more flexible nature; including the support for >> roles with dice ha

[ANN] Pyclewn: Vim as a front end to pdb

2010-12-05 Thread Xavier de Gaye
Pyclewn 1.5 has been released at http://pyclewn.sourceforge.net/ Pyclewn is a python program that allows the use of Vim as a front end to gdb and pdb. This release adds support for ``pdb``, the python debugger. + A python script may be run under the control of ``pdb``. For example the curren

Re: Perceived inconsistency in py3k documentation

2010-12-05 Thread Peter Otten
Greg wrote: > This is my first post here, so if this is not the correct place to ask > this, please direct me to the best place. This is a good place to get general advice and to discuss potential bugs when you are unsure whether they actually are bugs. If you are sure that you ran into a bug in

s;hlhdlhlah

2010-12-05 Thread hollyood
lhdglfhglshglhash -- http://mail.python.org/mailman/listinfo/python-list

Deditor 0.2.3

2010-12-05 Thread Kruptein
A new version of the python dedicated linux text-editor has been released! This editor is python specific offering some features to python users like code analyzing, code inspecting, syntax highlighting, ... Information about this project: http://launchpad.net/deditor Information about the latest

Re: Comparison with False - something I don't understand

2010-12-05 Thread Paul Rubin
Tim Harig writes: > The fact that I bothered to create classes for the dice and roles, rather > then simply iterating over a list of numbers, should tell you that I > produced was of a far more flexible nature; including the support for > roles with dice having different numbers of sides. fr

Perceived inconsistency in py3k documentation

2010-12-05 Thread Greg
Hello, This is my first post here, so if this is not the correct place to ask this, please direct me to the best place. In looking at the py3k documentation for comparing two classes, two different view points are expressed (at least it seems so to me). 1) At http://docs.python.org/py3k/reference

Re: Which non SQL Database ?

2010-12-05 Thread John Nagle
On 12/4/2010 8:44 PM, Monte Milanuk wrote: On 12/4/10 3:43 PM, Jorge Biquez wrote: I do not see a good reason for not using Sqlite3 BUT if for some reason would not be an option what plain schema of files would you use? Would shelve work? There are some systems for storing key-value