Papywizard 2.0.0

2009-03-15 Thread Frédéric
I'm pleased to announce the new release of Papywizard 2.0.0!     http://trac.gbiloba.org/papywizard This new branch now uses PyQt as graphical toolkit. This first release does not add many new features, and is more or less the same as the 1.6.1. But it can now run on MacOS (binary package coming

ANN: OpenOpt 0.23 - free numerical optimization framework

2009-03-15 Thread dmitrey
Hi all, OpenOpt 0.23, a free Python-written numerical optimization framework (license: BSD) with some own solvers and connections to tens of 3rd party ones, has been released. Our new homepage: http://openopt.org Introduction to the framework: http://openopt.org/Foreword All release details are

pywinauto 0.3.8 released - collection of changes from the last two years

2009-03-15 Thread Mark Mc Mahon
Hi, The 0.3.8 release of pywinauto is now available. pywinauto is a set of open-source (LGPL) modules for using Python as a GUI automation 'driver' for Windows NT based Operating Systems (NT/W2K/XP). SourceForge project page: http://sourceforge.net/projects/pywinauto Download from SourceForge

pyxser, python xml serialization

2009-03-15 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 pxyser --- python xml serialization (beta release 0.1). pyxser is a C written extension that serializes/deserializes python objects in XML format. It uses a DTD to create a valid XML tree under UTF-8 encoding. the project web page is at:

[ANNOUNCE] bzr 1.13 released

2009-03-15 Thread Bob Tanner
This release includes bug fixes and a few performance and feature improvements. GNU Changelog output can now be produced by ``bzr log --format gnu- changelog``. Debug flags can now be set in ``~/.bazaar/bazaar.conf``. Lightweight Checkouts and Stacked Branches should both be much faster over

Re: how to repeat function definitions less

2009-03-15 Thread Michele Simionato
On Mar 15, 12:09 am, s...@pobox.com wrote:     I'm doing this in my code, how to make it define all this functions for me     with lambda, I've been up for a while and cant seem to figure it out, whats     the most efficient way to do it? with lambda? how? thx     def

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
sweet, I've been wondering how those work. I've read some stuff about them and still doesn't make sense to me. Why would I want to use itPlease explain, thank you -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 1:05 AM, Michele Simionato michele.simion...@gmail.com wrote: On

suggestion for python function calling

2009-03-15 Thread alex goretoy
hi i have a suggestion, surely this wont wonk, and is merely a suggestion to aedd this type of syntax to python This is an insperation from peps 318 def foo(self): perform method operation foo = classmethod(foo) where it says perform mthod operation, why not have that be an actual

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
basically import os def quacks(self,value): return (1,0)[value] _aduck=~/goose duck = if os.path.exists quacks str(_aduck) duck()() or does this get in the way with some other pre-existing syntax interpretation implementations? -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at

Re: Subprocess module: running an interactive shell

2009-03-15 Thread Joe Tyson
On 2009-03-14 20:10:29 -0400, Karthik Gurusamy kar1...@gmail.com said: On Mar 14, 3:03 am, Roman Medina-Heigl Hernandez ro...@rs-labs.com wrote: Karthik Gurusamy escribió: On Mar 13, 6:39 pm, Roman Medina-Heigl Hernandez ro...@rs-labs.com wrote: Hi, I'm experimenting with Python and I

Is this type of forward referencing possible?

2009-03-15 Thread Kooks are people too
If I try this: class A: someType = B class B: anotherType = A I get: type 'exceptions.NameError': name 'B' is not defined args = (name 'B' is not defined,) message = name 'B' is not defined Presumably because I'm instantiating an instance of a type object (B) that doesn't

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
actually it would be more like import os def quacks(value): return %s/%s%s% (os.environ[PWD],os.path.dirname(__file__),value) _aduck=goose duck = if is not os.path.exists quacks str(_aduck) to perform the calls duck()() this would only with with functions that return something though, I

Re: how to repeat function definitions less

2009-03-15 Thread Michele Simionato
On Sun, Mar 15, 2009 at 7:33 AM, alex goretoy aleksandr.gore...@gmail.com wrote: sweet, I've been wondering how those work. I've read some stuff about them and still doesn't make sense to me. Why would I want to use itPlease explain, thank you Well, the typical usage for class decorators

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
or use . (dot) where variable and () (parans) where function duck()(). or duck.().() or for long sentences duck.[].()()... using dot seperator or double dot separator for application where its currently not being used, but for syntax errors -Alex Goretoy http://www.goretoy.com On Sun, Mar 15,

Re: suggestion for python function calling

2009-03-15 Thread alex goretoy
maybe this is like decorators -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 2:20 AM, alex goretoy aleksandr.gore...@gmail.comwrote: or use . (dot) where variable and () (parans) where function duck()(). or duck.().() or for long sentences duck.[].()()... using dot

Re: Is this type of forward referencing possible?

2009-03-15 Thread Lawrence D'Oliveiro
In message a96e95ab-9953-4e61- ad66-09759aa1c...@e1g2000pra.googlegroups.com, Kooks are people too wrote: If I try this: class A: someType = B class B: anotherType = A I get: type 'exceptions.NameError': name 'B' is not defined args = (name 'B' is not defined,)

Re: finally successful in ods with python, just one help needed.

2009-03-15 Thread John Machin
On Mar 15, 4:46 am, David Bolen db3l@gmail.com wrote: [snip] Note that it appears creating such a spreadsheet directly in Calc also adds covered table cells for those cells beneath the spanned cell, but Calc loads a file fine without those and still lets you later split the merge and

Re: ElementTree: How to return only unicode?

2009-03-15 Thread Stefan Behnel
Torsten Bronger wrote: Hallöchen! und zurück! Stefan Behnel writes: Torsten Bronger wrote: [...] My problem is that if there is only ASCII, these methods return ordinary strings instead of unicode. So sometimes I get str, sometimes I get unicode. Can one change this globally so

Re: ElementTree: How to return only unicode?

2009-03-15 Thread Torsten Bronger
Hallöchen! Stefan Behnel writes: Torsten Bronger wrote: Stefan Behnel writes: Torsten Bronger wrote: [...] My problem is that if there is only ASCII, these methods return ordinary strings instead of unicode. So sometimes I get str, sometimes I get unicode. Can one change this

Re: String to sequence

2009-03-15 Thread mattia
Il Sat, 14 Mar 2009 15:30:29 -0500, Tim Chase ha scritto: How can I convert the following string: 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC', EGC','SXF','BZR','BIQ','BLL','BHX','BLQ' into this sequence: ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',

Re: Is this type of forward referencing possible?

2009-03-15 Thread andrew cooke
someone else has answered this, but an extra trick that is sometimes useful is that while there is no forward referencing you can often exploit late binding and evaluation order. your example will not work because code at the class level is evaluated when the module is loaded. but code at the

Re: List the moduels of a package

2009-03-15 Thread Lie Ryan
mattia wrote: Hi all, how can I list the modules provided by a package? import package help(package) -- http://mail.python.org/mailman/listinfo/python-list

Re: Integer arithmetic in hardware descriptions

2009-03-15 Thread bearophileHUGS
John Nagle: I gave up on this when C came in; the C crowd was so casual about integer overflow that nobody cared about this level of correctness. Today, of course, buffer overflows are a way of life. Experience shows that integer overflows are a very common bug. One of the huge advantages of

Re: Style question - defining immutable class data members

2009-03-15 Thread Matthew Woodcraft
Gary Herron gher...@islandtraining.com writes: Gary Herron gher...@islandtraining.com wrote: No, you are still misinterpreting your results. But you can be forgiven because this is quite a subtle point about Python's attribute access. Here's how it works: On access, self.count (or

PyPy Progress (and Psyco)

2009-03-15 Thread andrew cooke
This looks very promising - http://www.voidspace.org.uk/python/weblog/arch_d7_2009_03_14.shtml#e1063 I am really looking forwards to PyPy having a final release. I hope it happens. Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
On Sun, 15 Mar 2009 13:26:17 -, Matthew Woodcraft matt...@woodcraft.me.uk wrote: [snip Gary Herron's explanation of instance attribute lookup falling back to class attribute lookup] It seems clear to me that Maxim understood all this when he asked his original question (you need to

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread Hendrik van Rooyen
Tim Rowe digil.com wrote: 8 - . If Finance users and non-professional programmers find the locale approach to be frustrating, arcane and non-obvious then by all means propose a way of making it simpler and clearer,

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread Hendrik van Rooyen
Paul Rubin http://phr...@nospam.invalid wrote: Paul Rubin http://phr...@nospam.invalid writes: '%.3K' % 1234567 = 1.235K # K = 1000 '%.:3Ki' % 1234567 = 1.206K # K = 1024 I meant 1.235M and 1.177M, of course. I went tilt like a slot machine long before I noticed... :-) -

DataObjects

2009-03-15 Thread Paulo Cheque
Please, let me know if this library is useful or not: http://code.google.com/p/python-dataobjects/ []s Paulo -- http://mail.python.org/mailman/listinfo/python-list

List the moduels of a package

2009-03-15 Thread mattia
Hi all, how can I list the modules provided by a package? -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding/decoding: Still don't get it :-/

2009-03-15 Thread Johannes Bauer
Peter Otten schrieb: encoding = sys.stdout.encoding or ascii for row in rows: id, address = row[:2] print id, address.encode(encoding, replace) Example: uähnlich lölich üblich.encode(ascii, replace) '?hnlich l?lich ?blich' A very good tip, Peter - I've also had this problem

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread JanC
Raymond Hettinger wrote: No doubt that you're skeptical of anything you didn't already know ;-) I'm a CPA, was a 15 year division controller for a Fortune 500 company, and an auditor for an international accounting firm. Believe me when I say it is the norm in finance. Besides, it seems

Re: tkinter: loading file before entering mainloop

2009-03-15 Thread Peter Billam
On 2009-03-14, Peter Otten __pete...@web.de wrote: Well, I don't know where the ymid[...] values come from. If you can guarantee that ymid[track_num] - ymid[track_num-1] 50 at some point you could reschedule loadFile() from within loadFile() and return immediately as long as that condition is

Re: Style question - defining immutable class data members

2009-03-15 Thread Matthew Woodcraft
Rhodri James rho...@wildebst.demon.co.uk writes: On Sun, 15 Mar 2009 13:26:17 -, Matthew Woodcraft It seems clear to me that Maxim understood all this when he asked his original question (you need to understand this subtlety to know why the trick he was asking about only works for

Re: Is this type of forward referencing possible?

2009-03-15 Thread Paul McGuire
On Mar 15, 6:33 am, andrew cooke and...@acooke.org wrote: someone else has answered this, but an extra trick that is sometimes useful is that while there is no forward referencing you can often exploit late binding and evaluation order. your example will not work because code at the class

Re: Is this type of forward referencing possible?

2009-03-15 Thread andrew cooke
Paul McGuire wrote: On Mar 15, 6:33 am, andrew cooke and...@acooke.org wrote: someone else has answered this, but an extra trick that is sometimes useful is that while there is no forward referencing you can often exploit late binding and evaluation order. [...] Not the same. The OP wanted

Re: PyPy Progress (and Psyco)

2009-03-15 Thread Gerhard Häring
andrew cooke wrote: This looks very promising - http://www.voidspace.org.uk/python/weblog/arch_d7_2009_03_14.shtml#e1063 I am really looking forwards to PyPy having a final release. I hope it happens. Me too. I doubt it, though. From an outside view, the project seems to lack focus. To me,

Re: how to repeat function definitions less

2009-03-15 Thread MRAB
alex goretoy wrote: I would imagine that I could do this with a generator and setattr, but I am still learning how to do that kinda of codingmaybe if I had a dictionary like this and then loaded it d={ site_name:[s,site,'sites','site_name','site_names'],

Is this type of forward referencing possible?

2009-03-15 Thread R. David Murray
Kooks are people too greedw...@gmail.com wrote: If I try this: class A: someType = B class B: anotherType = A I get: type 'exceptions.NameError': name 'B' is not defined args = (name 'B' is not defined,) message = name 'B' is not defined Presumably because

Re: Is this type of forward referencing possible?

2009-03-15 Thread Miles
On Sun, Mar 15, 2009 at 11:33 AM, Paul McGuire wrote: I'm guessing the class mapping is all part of an overall design, so I would define all of these after creating A and B as empty classes: class A: pass class B: pass A.someType = B B.anotherType = A While this would work in the general

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
On Sun, 15 Mar 2009 15:05:04 -, Matthew Woodcraft matt...@woodcraft.me.uk wrote: Rhodri James rho...@wildebst.demon.co.uk writes: On Sun, 15 Mar 2009 13:26:17 -, Matthew Woodcraft It seems clear to me that Maxim understood all this when he asked his original question (you need to

Re: Style question - defining immutable class data members

2009-03-15 Thread Bruno Desthuilliers
Maxim Khitrov a écrit : On Sat, Mar 14, 2009 at 2:07 PM, Gary Herron gher...@islandtraining.com wrote: Maxim Khitrov wrote: Very simple question on the preferred coding style. I frequently write classes that have some data members initialized to immutable values. For example: class

Re: Style question - defining immutable class data members

2009-03-15 Thread Aaron Brady
On Mar 15, 8:56 am, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sun, 15 Mar 2009 13:26:17 -, Matthew Woodcraft   matt...@woodcraft.me.uk wrote: [snip Gary Herron's explanation of instance attribute lookup falling back to class attribute lookup] It seems clear to me that Maxim

How to add months to a date (datetime object)?

2009-03-15 Thread tinnews
I have a date in the form of a datetime object and I want to add (for example) three months to it. At the moment I can't see any very obvious way of doing this. I need something like:- myDate = datetime.date.today() inc = datetime.timedelta(months=3) myDate += inc but, of course,

Re: Style question - defining immutable class data members

2009-03-15 Thread M R A Barnett
Aaron Brady wrote: [snip] However, in my (opined) interpretation, 'list.append(...) is an in- place operation' is a factual error. In-place operations -also- rebind their 'argument' (FLOBW for lack of better words). 'append' is a by-side-effect operation. However colloquially it's mostly

Re: Style question - defining immutable class data members

2009-03-15 Thread John Posner
(My apologies if the thread has already covered this.) I believe I understand the WHAT in this situation, but I don't understand the WHY ... Given this class definition: class Cls(object): x = 345 ... I observe the following, using IDLE 2.6.1: inst = Cls() Cls.x is inst.x True

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Chris Rebert
On Sun, Mar 15, 2009 at 10:28 AM, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I can't see any very obvious way of doing this.  I need something like:-    myDate = datetime.date.today()    inc =

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Vlastimil Brom
2009/3/15 tinn...@isbd.co.uk: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I can't see any very obvious way of doing this.  I need something like:-    myDate = datetime.date.today()    inc = datetime.timedelta(months=3)  

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Roy Smith
In article 49bd3ab8$0$510$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it. At the moment I can't see any very obvious way of doing this. I need something like:- myDate =

Re: Style question - defining immutable class data members

2009-03-15 Thread Aaron Brady
On Mar 15, 12:39 pm, John Posner jjpos...@snet.net wrote: (My apologies if the thread has already covered this.) I believe I understand the WHAT in this situation, but I don't understand the WHY ... Given this class definition:   class Cls(object):       x = 345 ... I observe the

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
I will also actually need to nest it like so d={ site_name:[s,site,' sites','site_name','site_names'], jar_name:[j,jar,'jars','jar_name','jar_names'], options:{ src_name:[ss,src,source], mod_name:['m',mod,'mods',module,modules], } -Alex Goretoy

Re: How to add months to a date (datetime object)?

2009-03-15 Thread tinnews
Roy Smith r...@panix.com wrote: In article 49bd3ab8$0$510$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it. At the moment I can't see any very obvious way of doing this. I need

Re: How to add months to a date (datetime object)?

2009-03-15 Thread tinnews
Chris Rebert c...@rebertia.com wrote: On Sun, Mar 15, 2009 at 10:28 AM, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I can't see any very obvious way of doing this.  I need something like:-  

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
this means i have to check if d[i] is list or dict and iterate over properties -Alex Goretoy http://www.goretoy.com On Sun, Mar 15, 2009 at 1:03 PM, alex goretoy aleksandr.gore...@gmail.comwrote: I will also actually need to nest it like so d={ site_name:[s,site,'

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Andre Engels
On Sun, Mar 15, 2009 at 7:00 PM, tinn...@isbd.co.uk wrote: Roy Smith r...@panix.com wrote: In article 49bd3ab8$0$510$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Chris Rebert
On Sun, Mar 15, 2009 at 11:00 AM, tinn...@isbd.co.uk wrote: Roy Smith r...@panix.com wrote: In article 49bd3ab8$0$510$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Ned Deily
In article 49bd42ac$0$512$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I was just hoping there was some calendar object in Python which could do all that for me (I need the handling of 31st and February etc.) Whatever your requirement, chances are dateutil will be of help:

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread Rhodri James
On Sat, 14 Mar 2009 08:20:21 -, Hendrik van Rooyen m...@microcorp.co.za wrote: Tim Rowe digil.com wrote: 8 - . If Finance users and non-professional programmers find the locale approach to be frustrating,

Re: PyWin32 for Python 3.x

2009-03-15 Thread John Nagle
Tim Golden wrote: John Nagle wrote: Any idea when PyWin32 will be available for Python 3.x? John Nagle Release 213 is out already: http://sourceforge.net/project/showfiles.php?group_id=78018package_id=79063release_id=661475 I think it's still considered a little bit

Re: PyWin32 for Python 3.x

2009-03-15 Thread Tim Golden
John Nagle wrote: That wizard won't even install unless Python 3.0 is in the registry, which apparently means installed as the default Python. No, it just means installed somewhere. I have 6 different versions of Python installed on this box. The choice of which is the default is mine,

Re: Style question - defining immutable class data members

2009-03-15 Thread Rhodri James
On Sun, 15 Mar 2009 17:55:25 -, Aaron Brady castiro...@gmail.com wrote: On Mar 15, 12:39 pm, John Posner jjpos...@snet.net wrote: (My apologies if the thread has already covered this.) I believe I understand the WHAT in this situation, but I don't understand the WHY ... [snip] My

Re: PyPy Progress (and Psyco)

2009-03-15 Thread Fuzzyman
On Mar 15, 3:46 pm, Gerhard Häring g...@ghaering.de wrote: andrew cooke wrote: This looks very promising - http://www.voidspace.org.uk/python/weblog/arch_d7_2009_03_14.shtml#e1063 I am really looking forwards to PyPy having a final release.  I hope it happens. Me too. I doubt it,

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-15 Thread MRAB
Rhodri James wrote: [snip] Frankly, I'd much rather fix the locale system and extend the format syntax to override the default locale. Perhaps something like financial = Locale(group_sep=,, grouping=[3]) print(my number is {0:10n:financial}.format(1234567)) It's hard to think of a way of

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Casey Webster
On Mar 15, 2:00 pm, tinn...@isbd.co.uk wrote: No, it's perfectly possible applying simple logic.  My reminder program manages it perfectly well.  I have, for example, two sets of three monthly reminders.     One starts on Jan 19th and repeats three monthly, that means Jan     19th, April

Re: Is this type of forward referencing possible?

2009-03-15 Thread Kooks are people too
On Mar 15, 9:22 am, Miles semantic...@gmail.com wrote: (I suspect the OP neglected to point out that A and B likely both inherit from db.Model). -Miles yes, I did neglect to state that A and B inherit from db.Model. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to add months to a date (datetime object)?

2009-03-15 Thread John Yeung
On Mar 15, 3:10 pm, Casey Webster casey...@gmail.com wrote: The example you give does have fairly obvious logic. But how does it handle Feb 28th, 2009 + 3 months?  To me, there are two obvious answers: May 28th, 2009 or May 31st, 2009.  The question is intent; is Feb 28th an arbitrary day of

ANN: OpenOpt 0.23 - free numerical optimization framework

2009-03-15 Thread dmitrey
Hi all, OpenOpt 0.23, a free numerical optimization framework (license: BSD) with some own solvers and connections to tens of 3rd party ones, has been released. Our new homepage: http://openopt.org Introduction to the framework: http://openopt.org/Foreword All release details are here:

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
this is what I did to define all my color functions by color name, but I am still going to need a good solution for args #import functions by color name into current namespace for color in self.colors.keys(): setattr(self, color,lambda x,y=color,z=INFO:

Re: PyWin32 for Python 3.x

2009-03-15 Thread John Nagle
Tim Golden wrote: John Nagle wrote: That wizard won't even install unless Python 3.0 is in the registry, which apparently means installed as the default Python. No, it just means installed somewhere. I have 6 different versions of Python installed on this box. The choice of which is the

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Roy Smith
In article 49bd4252$0$512$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: Well, before you can add three months to something, you need to explain what that means. [...] No, it's perfectly possible applying simple logic. I didn't say it was not possible. I just said that a

Re: PyWin32 for Python 3.x

2009-03-15 Thread Tim Golden
John Nagle wrote: Well, of some other packages I use: MySQLdb: Python versions 2.3-2.5 are supported. Ref: http://sourceforge.net/projects/mysql-python M2Crypto: Latest version is for Python 2.6. Ref: http://chandlerproject.org/bin/view/Projects/MeTooCrypto Somebody

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Roy Smith
In article mailman.1915.1237140862.11746.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: Besides your behavior, one could equally well argue that a 31st repeat on months without a 31st should just be dropped, or that it should carry over onto the 1st of the next month (ignoring

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
Michele I tried your way but I dont seem to have a good grasp on the concept yet, will read up more for now I think I will try to make it work same way as colors only with decorator as def inside def instead of @, that doesn't make sense quite yet -Alex Goretoy http://www.goretoy.com On Sun,

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Roy Smith
In article mailman.1910.1237139217.11746.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: Which makes some sense considering a month can range from 28-31 days, which would make the delta oddly fuzzy. BTW, what date is One month after August 10, 1752? Extra points if you refuse

Set overlapping

2009-03-15 Thread mattia
How can I determine the common values found in two differents sets and then assign this values? E.g. dayset = [Mon, Tue, Wed, Thu, Fri, Sat, Sun] monthset = [Jan, Feb, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec] this are the fixed and standard sets. Then I have others sets that contains one

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Chris Rebert
On Sun, Mar 15, 2009 at 1:30 PM, Roy Smith r...@panix.com wrote: In article mailman.1910.1237139217.11746.python-l...@python.org,  Chris Rebert c...@rebertia.com wrote: Which makes some sense considering a month can range from 28-31 days, which would make the delta oddly fuzzy. BTW, what

Re: Set overlapping

2009-03-15 Thread Chris Rebert
On Sun, Mar 15, 2009 at 1:41 PM, mattia ger...@gmail.com wrote: How can I determine the common values found in two differents sets and then assign this values? E.g. dayset = [Mon, Tue, Wed, Thu, Fri, Sat, Sun] monthset = [Jan, Feb, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec] this are the

Re: PyPy Progress (and Psyco)

2009-03-15 Thread andrew cooke
Fuzzyman wrote: On Mar 15, 3:46 pm, Gerhard Häring g...@ghaering.de wrote: [...] Me too. I doubt it, though. From an outside view, the project seems to lack focus. To me, it looks like a research platform, and producing a successor to CPython seems to be just one out of a dozen projects. [...]

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
this is the final result of the args i will be parsing for now d={ site_name:[s,sn,site,'sites','site_name','site_names'], jar_name:[j,jn,jar,'jars','jar_name','jar_names'], file_name:[f,fn,'file','files','filename','filenames','file_name','file_names'],

Re: Style question - defining immutable class data members

2009-03-15 Thread Matthew Woodcraft
John Posner jjpos...@snet.net writes: My question is ... WHY does the interpreter silently create the instance attribute at this point, causing a surprising decoupling from the class attribute? WHY doesn't the interpreter behave as it would with a simple, non-instance variable: python

Re: Style question - defining immutable class data members

2009-03-15 Thread Bruno Desthuilliers
Rhodri James a écrit : On Sun, 15 Mar 2009 17:55:25 -, Aaron Brady castiro...@gmail.com wrote: On Mar 15, 12:39 pm, John Posner jjpos...@snet.net wrote: (snip) Is there a beneficial effect of silently creating the instance attribute, which outweighs the detrimental effects: (1)

Re: Style question - defining immutable class data members

2009-03-15 Thread Matthew Woodcraft
Rhodri James rho...@wildebst.demon.co.uk writes: But do you, though? The only occasion I can think of that I'd want the search to go past the instance is this auto-initialisation, and frankly I'd rather do that in an __init__ anyway. Perhaps static methods or class methods work that way, I

Re: Style question - defining immutable class data members

2009-03-15 Thread Bruno Desthuilliers
John Posner a écrit : (My apologies if the thread has already covered this.) I believe I understand the WHAT in this situation, but I don't understand the WHY ... Given this class definition: class Cls(object): x = 345 ... I observe the following, using IDLE 2.6.1: inst = Cls() Cls.x is

Re: ipython / vs \ in readline on MS Windows (and ipython help grepper)

2009-03-15 Thread Tim Roberts
Jason Scheirer jason.schei...@gmail.com wrote: Cygwin does not magically change the platform you are on, the fact that you are on Windows is hard-coded into the Python.exe binary. Look for references to os.path.sep in IPython. Windows does let you use forward slashes as path separators, though,

Re: Style question - defining immutable class data members

2009-03-15 Thread R. David Murray
M R A Barnett p...@mrabarnett.plus.com wrote: Aaron Brady wrote: [snip] However, in my (opined) interpretation, 'list.append(...) is an in- place operation' is a factual error. In-place operations -also- rebind their 'argument' (FLOBW for lack of better words). 'append' is a

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Roy Smith
In article mailman.1924.1237149940.11746.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: Not that that date could even be represented by most programs since it's before 1970. Talk about recentism! :-) I've always wondered how historians using computers deal with that

Re: How to add months to a date (datetime object)?

2009-03-15 Thread CM
On Mar 15, 1:28 pm, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I can't see any very obvious way of doing this.  I need something like:-     myDate = datetime.date.today()     inc =

Re: How to add months to a date (datetime object)?

2009-03-15 Thread John Machin
On Mar 16, 7:30 am, Roy Smith r...@panix.com wrote: In article mailman.1910.1237139217.11746.python-l...@python.org,  Chris Rebert c...@rebertia.com wrote: Which makes some sense considering a month can range from 28-31 days, which would make the delta oddly fuzzy. BTW, what date is One

Re: How to add months to a date (datetime object)?

2009-03-15 Thread John Machin
On Mar 16, 6:55 am, John Yeung gallium.arsen...@gmail.com wrote: On Mar 15, 3:10 pm, Casey Webster casey...@gmail.com wrote: The example you give does have fairly obvious logic. But how does it handle Feb 28th, 2009 + 3 months?  To me, there are two obvious answers: May 28th, 2009 or May

Re: how to repeat function definitions less

2009-03-15 Thread alex goretoy
ok now for the final result, i decided to split options out to a separate dict of lists, does this look right to every one, I currently have error somewhere else in my code so can't test this right now, Is this a good method to do this? or is there another option? self.opt={}

Re: PyWin32 for Python 3.x

2009-03-15 Thread Mark Hammond
On 16/03/2009 6:05 AM, John Nagle wrote: Tim Golden wrote: John Nagle wrote: Any idea when PyWin32 will be available for Python 3.x? John Nagle Release 213 is out already: http://sourceforge.net/project/showfiles.php?group_id=78018package_id=79063release_id=661475 I think it's still

Re: Get pixel colors from images in Python 3

2009-03-15 Thread Tim Roberts
Cro prah...@gmail.com wrote: As the title sais, i am trying to extract pixel colors from images, in Python 3. ... Can anyone suggest how to do that ? The bigger problem is that i need to extract pixel colors for many types of images : JPEG, PNG, BMP, GIF. For this, i might need different

Re: Style question - defining immutable class data members

2009-03-15 Thread John Posner
Matthew Woodcraft said: I doubt it's because anyone particularly wanted this behaviour; it just falls out of the way '+=' is defined. At the point where 'inst.x += 1' is compiled, Python doesn't know whether 'inst.x' is going to turn out to be a class attribute or an instance attribute

Re: can error messages be improved or can they be overridden ?

2009-03-15 Thread Stef Mientki
thanks RDM, I finally had a case where I really needed it, so it tried, works perfect, except the marked lines should be indented 1 more. cheers, Stef rdmur...@bitdance.com wrote: andrew cooke and...@acooke.org wrote: rdmur...@bitdance.com wrote: [...] (You know, I really ought to

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Steve Holden
Roy Smith wrote: In article 49bd3ab8$0$510$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it. At the moment I can't see any very obvious way of doing this. I need something like:-

Correct URL encoding

2009-03-15 Thread mattia
I'm using urlopen in order to download some web pages. I've always to replace some characters that are in the url, so I've come up with: url.replace(|, %7C).replace(/, %2F).replace( , +).replace (:, %3A) There isn't a better way of doing this? --

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Chris Rebert
On Sun, Mar 15, 2009 at 4:17 PM, Steve Holden st...@holdenweb.com wrote: Roy Smith wrote: In article 49bd3ab8$0$510$bed64...@news.gradwell.net, tinn...@isbd.co.uk wrote: I have a date in the form of a datetime object and I want to add (for example) three months to it.  At the moment I can't

Re: Correct URL encoding

2009-03-15 Thread Chris Rebert
On Sun, Mar 15, 2009 at 4:21 PM, mattia ger...@gmail.com wrote: I'm using urlopen in order to download some web pages. I've always to replace some characters that are in the url, so I've come up with: url.replace(|, %7C).replace(/, %2F).replace( , +).replace (:, %3A) There isn't a better way

Re: Style question - defining immutable class data members

2009-03-15 Thread Aaron Brady
On Mar 15, 1:50 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sun, 15 Mar 2009 17:55:25 -, Aaron Brady castiro...@gmail.com   wrote: On Mar 15, 12:39 pm, John Posner jjpos...@snet.net wrote: (My apologies if the thread has already covered this.) I believe I   understand the

Re: can error messages be improved or can they be overridden ?

2009-03-15 Thread andrew cooke
rdmur...@bitdance.com wrote: andrew cooke and...@acooke.org wrote: rdmur...@bitdance.com wrote: [...] (You know, I really ought to revisit that routine and make it part of my standard development toolbox.) please post it OK. I dug it up, cut out the stuff that was specific to the

  1   2   >