Re: Advanced Python Programming Oxford Lectures [was: Re: *Advanced* Python book?]

2010-03-26 Thread Lacrima
On Mar 26, 10:22 am, Michele Simionato wrote: > On Mar 25, 2:24 pm, Michele Simionato > wrote: > > > On Mar 25, 1:28 pm, Ethan Furman wrote: > > > > Michele, > > > > Was wondering if you'd had a chance to re-post your lectures -- just did > > > a search for them and came up empty, and I would lo

python

2010-03-26 Thread matttibbals
I'm Matt Tibbals, pedophile. http://www.matthewtibbals.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Represent object type as

2010-03-26 Thread Gregory Ewing
Jason wrote: I'm reusing the __getstate__ function I wrote for pickling like so: Instead of reinventing part of pickle, is there some reason you couldn't just use it? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: from import and __init__.py

2010-03-26 Thread Gregory Ewing
egbert wrote: Yes, you are right. And I can reach everything with modules['some_package'] or variants thereof. Although note that the usual way to get it would be to simply do import some_package -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: GIF89A and PIL

2010-03-26 Thread Stephen Hansen
On 2010-03-26 21:37:10 -0700, Lawrence D'Oliveiro said: In message <2010032618455468300-aptshan...@gmailinvalid>, Stephen Hansen wrote: Is it possible to get PIL to save GIF's in GIF89A format, instead of GIF87A? Why? What does GIF do for you that PNG doesn’t? If I take this PSD and save i

Re: GIF89A and PIL

2010-03-26 Thread Lawrence D'Oliveiro
In message <2010032618455468300-aptshan...@gmailinvalid>, Stephen Hansen wrote: > Is it possible to get PIL to save GIF's in GIF89A format, instead of > GIF87A? Why? What does GIF do for you that PNG doesn’t? -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic import ?

2010-03-26 Thread MRAB
C. B. wrote: At first, thank you all for your answers. Some more details about what I'm coding and what I need... The classes AAA and BBB are just given as examples. In fact, BBB's constructor accepts several parameters, meaning it can be different for each creation of AAA. So it can't be simpl

Re: Advice Criticism on Python App

2010-03-26 Thread Tim Roberts
Steven D'Aprano wrote: >On Wed, 24 Mar 2010 21:14:23 -0700, Tim Roberts wrote: > >> Jimbo wrote: >>> >>>class stock: >>>code = "" >>>purchasePrice= 0 >>>purchaseQuantity = 0 >>>price= [] # list of recent prices >>>recentBid= [] # list of

Re: Automatic import ?

2010-03-26 Thread Steven D'Aprano
On Fri, 26 Mar 2010 18:18:07 -0700, C. B. wrote: > It takes time to write the relative importations, that's ok, but I think > it could be more pleasant for the end-user to not have to write a huge > list of "from mymodule import xxx" if it is possible to take advantage > of automatic importations.

GIF89A and PIL

2010-03-26 Thread Stephen Hansen
Hi, all. Is it possible to get PIL to save GIF's in GIF89A format, instead of GIF87A? If not, are there any decent other image libraries out there that anyone's familiar with? The only one I could find was PythonMagick, which seems completely undocumented. Or I'm blind. Ahem. But the proble

Re: Automatic import ?

2010-03-26 Thread C. B.
At first, thank you all for your answers. Some more details about what I'm coding and what I need... The classes AAA and BBB are just given as examples. In fact, BBB's constructor accepts several parameters, meaning it can be different for each creation of AAA. So it can't be simply skipped from

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread Ethan Furman
Jon Clements wrote: On 26 Mar, 09:49, James Harris wrote: On 25 Mar, 22:56, Jon Clements wrote: On 25 Mar, 22:40, James Harris wrote: I am looking to store named pieces of text in a form that can be edited by a standard editor such as notepad (under Windows) or vi (under Unix) and th

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread geremy condra
On Fri, Mar 26, 2010 at 9:23 AM, Harishankar wrote: > Have you people embraced Python 3.x or still with 2.5 or 2.6? > > I personally want to switch over but not too sure how many people are > using 3.x as opposed to 2 so I want to keep my programs compatible for > the majority. > > -- Hari > -- >

Re: Classes as namespaces?

2010-03-26 Thread Steven D'Aprano
On Fri, 26 Mar 2010 14:49:02 +, kj wrote: > What's the word on using "classes as namespaces"? >>> import this [...] Namespaces are one honking great idea -- let's do more of those! > [*] My own subjective dislike for the widespread practice of using > triple quotes to comment out code i

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Terry Reedy
On 3/26/2010 9:23 AM, Harishankar wrote: Have you people embraced Python 3.x? Yes. My current work only needs the stdlib and I much prefer the streamlined language. -- http://mail.python.org/mailman/listinfo/python-list

Re: exec .exe

2010-03-26 Thread wukong
On Mar 26, 3:10 pm, Irmen de Jong wrote: > On 26-3-2010 22:58, wukong wrote: > > > newbie question, how do you run a .exe generated by MSVC++ in python > > in windows? > > Use the subprocess module, for instance: > subprocess.call(["notepad.exe", "d:/file.txt"]) > > irmen worked like a charm, :-)

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Cameron Simpson
On 26Mar2010 07:29, Sebastien Binet wrote: | On Mar 25, 10:39 pm, Winston wrote: | > A Baton object for generators to allow subfunction to yield, and to | > make them symetric. | | isn't a Baton what CSP calls a channel ? I was thinking about this (roughly) in the shower this morning before see

Re: OT: Meaning of "monkey"

2010-03-26 Thread Emile van Sebille
On 3/26/2010 1:18 PM Mensanator said... On Mar 26, 2:44 pm, Phlip wrote: On Mar 26, 6:14 am, Luis M. González wrote: Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... Monkeys everywhere. Sorry for the o

Re: exec .exe

2010-03-26 Thread Irmen de Jong
On 26-3-2010 22:58, wukong wrote: newbie question, how do you run a .exe generated by MSVC++ in python in windows? Use the subprocess module, for instance: subprocess.call(["notepad.exe", "d:/file.txt"]) irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite version on windows

2010-03-26 Thread Lawrence D'Oliveiro
In message , Philip Semanchuk wrote: > On Mar 26, 2010, at 5:57 AM, Laszlo Nagy wrote: >> >> On my Linux system: Python version: 2.6.2 sqlite3.sqlite_version: >> 3.6.10 >> On my Windows system: Python version: 2.6.5 sqlite3.sqlite_version: >> 3.5.9 >> >> Why is that? > > The few Linux distros th

exec .exe

2010-03-26 Thread wukong
newbie question, how do you run a .exe generated by MSVC++ in python in windows? -- http://mail.python.org/mailman/listinfo/python-list

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Winston
On Mar 26, 7:29 am, Sebastien Binet wrote: > > Proposal for a new Generator Syntax in Python 3K-- > > A Baton object for generators to allow subfunction to yield, and to > > make > > them symetric. > > isn't a Baton what CSP calls a channel ? > > there is this interesting PyCSP library (which impl

Re: Classes as namespaces?

2010-03-26 Thread Ricardo Aráoz
Luis M. González wrote: > On 26 mar, 11:49, kj wrote: > >> What's the word on using "classes as namespaces"? E.g. >> >> class _cfg(object): >> spam = 1 >> jambon = 3 >> huevos = 2 >> >> breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) >> > > I see no problem. > I wouldn't mix

Re: Create a class at run-time

2010-03-26 Thread I V
On Fri, 26 Mar 2010 08:54:11 -0700, Michel wrote: > I want to add a method to a class such that it can be invoked on > specifics instances. > You solution works (as well as Patrick's one), thanks ! I still have a > question though. If I print the type of the self object I get when my > method is >

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Chris Colbert
On Fri, Mar 26, 2010 at 4:07 PM, Mensanator wrote: > On Mar 26, 8:23 am, Harishankar wrote: > > Have you people embraced Python 3.x or still with 2.5 or 2.6? > > 3.1. > > The only module I use regularly is gmpy and that's one that has > been updated. > -- > http://mail.python.org/mailman/listinf

Re: OT: Meaning of "monkey"

2010-03-26 Thread Mensanator
On Mar 26, 2:44 pm, Phlip wrote: > On Mar 26, 6:14 am, Luis M. González wrote: > > > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, > > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > > Monkeys everywhere. > > Sorry for the off topic question, but wha

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Mensanator
On Mar 26, 8:23 am, Harishankar wrote: > Have you people embraced Python 3.x or still with 2.5 or 2.6? 3.1. The only module I use regularly is gmpy and that's one that has been updated. -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging writes an empty file

2010-03-26 Thread Ovidiu Deac
It worked. Setting disable_existing_loggers=False fixed my problem. Thanks to both of you! Ovidiu On Fri, Mar 26, 2010 at 9:09 PM, Vinay Sajip wrote: > On Mar 26, 4:26 pm, Ovidiu Deac wrote: >> Anyway, thanks for the first part. >> >> Anybody else has any idea why using the same configuration f

Re: OT: Meaning of "monkey"

2010-03-26 Thread Phlip
On Mar 26, 6:14 am, Luis M. González wrote: > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > Monkeys everywhere. > Sorry for the off topic question, but what does "monkey" mean in a > nerdy-geek context

Re: [C-API] malloc error in PyDict_New

2010-03-26 Thread Stefan Behnel
Jonas H., 26.03.2010 20:10: I'm currently diving into Python C programming and I have a problem with `PyDict_New`. My application receives a SIGABRT from malloc every time I execute `PyDict_New`. malloc throws the following error: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((

Re: Create a class at run-time

2010-03-26 Thread Steve Holden
Michel wrote: > Thanks Peter. > > I searched a little bit more and wrote the following example: > > > import types > > class MyClass: > > def test_toto(self): > print type(self) > print self.name > > def test_toto(self): > print type

Re: Create a class at run-time

2010-03-26 Thread Peter Otten
Michel wrote: > Thanks Peter. > > I searched a little bit more and wrote the following example: > > > import types > > class MyClass: > > def test_toto(self): > print type(self) > print self.name > > def test_toto(self): > print typ

[C-API] malloc error in PyDict_New

2010-03-26 Thread Jonas H.
Hi there, I'm currently diving into Python C programming and I have a problem with `PyDict_New`. My application receives a SIGABRT from malloc every time I execute `PyDict_New`. malloc throws the following error: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &

Re: python logging writes an empty file

2010-03-26 Thread Vinay Sajip
On Mar 26, 4:26 pm, Ovidiu Deac wrote: > Anyway, thanks for the first part. > > Anybody else has any idea why using the same configuration file works > when running the tests with nosetests and doesn't work > withlogging.config.fileConfig() ? It's probably because the fileConfig code is intended

Re: Create a class at run-time

2010-03-26 Thread Michel
Thanks Peter. I searched a little bit more and wrote the following example: import types class MyClass: def test_toto(self): print type(self) print self.name def test_toto(self): print type(self) print self.name MyDynClass = typ

Re: Classes as namespaces?

2010-03-26 Thread Luis M . González
On 26 mar, 11:49, kj wrote: > What's the word on using "classes as namespaces"?  E.g. > > class _cfg(object): >     spam = 1 >     jambon = 3 >     huevos = 2 > > breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) I see no problem. I wouldn't mix English, French and Spanish in the same recipe thou

Re: Classes as namespaces?

2010-03-26 Thread Philip Semanchuk
On Mar 26, 2010, at 1:51 PM, kj wrote: Thanks for all your comments. I see that modules are arguably Python's standard way for implementing namespaces. I guess I tend to avoid modules primarily because of lingering mental trauma over incidents of insane/bizarro import bugs in the past. Ther

Re: Classes as namespaces?

2010-03-26 Thread kj
Thanks for all your comments. I see that modules are arguably Python's standard way for implementing namespaces. I guess I tend to avoid modules primarily because of lingering mental trauma over incidents of insane/bizarro import bugs in the past. (It's not rational, I know; it's like when on

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Nobody
On Fri, 26 Mar 2010 13:23:25 +, Harishankar wrote: > Have you people embraced Python 3.x or still with 2.5 or 2.6? Still with 2.6, and probably will be indefinitely. I use Python mostly for Unix scripting: the kind of task which would traditionally have used Bourne shell. For that purpose,

Re: Classes as namespaces?

2010-03-26 Thread Chris Colbert
i use them in Pymazon to encapsulate program wide settings and enforce valid values for these settings. http://code.google.com/p/pymazon/source/browse/pymazon/settings.py On Fri, Mar 26, 2010 at 11:50 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > kj wrote: > >> What's the word on

Re: Create a class at run-time

2010-03-26 Thread Peter Otten
Michel wrote: > Hi everyone, > > I'm trying to dynamically create a class. What I need is to define a > class, add methods to it and later instantiate this class. Methods > need to be bound to the instance though, and that's my problem. Here > is what I have so far: > > method_template = "def te

Re: OT: Meaning of "monkey"

2010-03-26 Thread Tim Wintle
On Fri, 2010-03-26 at 12:08 -0400, Mel wrote: > Somewhere on the Internet there's a particularly brilliant pop song > called "Code Monkey". http://www.jonathancoulton.com/2006/04/14/thing-a-week-29-code-monkey/ (he's linked to the mp3 from there) -- http://mail.python.org/mailman/listinfo/pytho

Re: python logging writes an empty file

2010-03-26 Thread Ovidiu Deac
Anyway, thanks for the first part. Anybody else has any idea why using the same configuration file works when running the tests with nosetests and doesn't work with logging.config.fileConfig() ? -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Meaning of "monkey"

2010-03-26 Thread Jon Clements
On 26 Mar, 15:45, Grant Edwards wrote: > On 2010-03-26, Luis M  Gonz?lez wrote: > > > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, J?germonkey, > > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > > Monkeys everywhere. > > Sorry for the off topic question, but wh

Re: OT: Meaning of "monkey"

2010-03-26 Thread Mel
Grant Edwards wrote: > However, it can be used among peers in an affectionate way. One may > refer to one's peer as "code monkey" without offense, but a manager > could not refer to one of his employees as a "code monkey" without > risking it being seen as an insult. Somewhere on the Internet the

Re: OT: Meaning of "monkey"

2010-03-26 Thread Robert Kern
On 2010-03-26 10:45 AM, Grant Edwards wrote: On 2010-03-26, Luis M Gonz?lez wrote: Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, J?germonkey, Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... Monkeys everywhere. Many people are accustomed to speaking anthopomorp

Re: Create a class at run-time

2010-03-26 Thread Michel
I want to add a method to a class such that it can be invoked on specifics instances. You solution works (as well as Patrick's one), thanks ! I still have a question though. If I print the type of the self object I get when my method is called, I get "". I guess this is because the method is define

Re: Classes as namespaces?

2010-03-26 Thread Jean-Michel Pichavant
kj wrote: What's the word on using "classes as namespaces"? E.g. class _cfg(object): spam = 1 jambon = 3 huevos = 2 breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) Granted, this is not the "intended use" for classes, and therefore could be viewed as a misuse ("that's what dic

Re: Classes as namespaces?

2010-03-26 Thread Jon Clements
On 26 Mar, 14:49, kj wrote: > What's the word on using "classes as namespaces"?  E.g. > > class _cfg(object): >     spam = 1 >     jambon = 3 >     huevos = 2 > > breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) > > Granted, this is not the "intended use" for classes, and therefore > could be vie

Re: OT: Meaning of "monkey"

2010-03-26 Thread Grant Edwards
On 2010-03-26, Luis M Gonz?lez wrote: > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, J?germonkey, > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > Monkeys everywhere. > Sorry for the off topic question, but what does "monkey" mean in a > nerdy-geek context?? I

Re: Classes as namespaces?

2010-03-26 Thread Jack Diederich
On Fri, Mar 26, 2010 at 10:49 AM, kj wrote: > > > What's the word on using "classes as namespaces"?  E.g. > > class _cfg(object): >    spam = 1 >    jambon = 3 >    huevos = 2 > > breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) Classes as namespaces are a valid use case (I do it all the time).

Re: python logging writes an empty file

2010-03-26 Thread Jean-Michel Pichavant
Ovidiu Deac wrote: You set le level of your handler, but did not set the level of the logger itself. Replace file.setLevel(logging.INFO) by logging.getLogger().setLevel(logging.INFO) Log events are matched versus the logger level 1st, then the handler level (if applicable). Most of the time you

Re: Classes as namespaces?

2010-03-26 Thread Philip Semanchuk
On Mar 26, 2010, at 10:49 AM, kj wrote: What's the word on using "classes as namespaces"? E.g. class _cfg(object): spam = 1 jambon = 3 huevos = 2 breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) Granted, this is not the "intended use" for classes, and therefore could be viewed

Re: Classes as namespaces?

2010-03-26 Thread Harishankar
On Fri, 26 Mar 2010 14:49:02 +, kj wrote: > What's the word on using "classes as namespaces"? E.g. > > class _cfg(object): > spam = 1 > jambon = 3 > huevos = 2 > > breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) > > > Granted, this is not the "intended use" for classes, and

Re: Create a class at run-time

2010-03-26 Thread Michel
Well, I don't have the reference to the instance. The class is actually instantiated later by a the unittest library. On Mar 25, 6:18 pm, Michiel Overtoom wrote: > On 2010-03-25 23:00, Michel wrote: > > > I'm trying to dynamically create a class. What I need is to define a > > class, add methods

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread Jon Clements
On 26 Mar, 09:49, James Harris wrote: > On 25 Mar, 22:56, Jon Clements wrote: > > > > > On 25 Mar, 22:40, James Harris wrote: > > > > I am looking to store named pieces of text in a form that can be > > > edited by a standard editor such as notepad (under Windows) or vi > > > (under Unix) and th

Re: sum for sequences?

2010-03-26 Thread Steve Howell
On Mar 26, 7:31 am, Steve Howell wrote: > On Mar 24, 4:19 pm, Paul Rubin wrote: > > > kj writes: > > > Is there a sequence-oriented equivalent to the sum built-in?  E.g.: > > >   seq_sum(((1, 2), (5, 6))) --> (1, 2) + (5, 6) --> (1, 2, 5, 6) > > > use itertools.chain for this.  A few people have

Re: OT: Meaning of "monkey"

2010-03-26 Thread Robert Kern
On 2010-03-26 08:14 AM, Luis M. González wrote: Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... Monkeys everywhere. Sorry for the off topic question, but what does "monkey" mean in a nerdy-geek context?? P

Classes as namespaces?

2010-03-26 Thread kj
What's the word on using "classes as namespaces"? E.g. class _cfg(object): spam = 1 jambon = 3 huevos = 2 breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) Granted, this is not the "intended use" for classes, and therefore could be viewed as a misuse ("that's what dictionaries a

Re: sum for sequences?

2010-03-26 Thread Steve Howell
On Mar 24, 4:19 pm, Paul Rubin wrote: > kj writes: > > Is there a sequence-oriented equivalent to the sum built-in?  E.g.: > >   seq_sum(((1, 2), (5, 6))) --> (1, 2) + (5, 6) --> (1, 2, 5, 6) > > use itertools.chain for this.  A few people have mentioned that sum will > also work, but I think for

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Gnarlodious
I have been using Py3 since October, I switched over for the OrderedDict feature. Some parts are a little hard to get used to, but others are easier. I am doing web programming, so the UTF 8 default is a big improvement. -- Gnarlie -- http://mail.python.org/mailman/listinfo/python-list

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Sebastien Binet
On Mar 25, 10:39 pm, Winston wrote: > Here's my proposal again, but hopefully with better formatting so you > can read it easier. > > -Winston > - > > Proposal for a new Generator Syntax in Python 3K-- > A Baton object for generators to allow subfunction to yield, and to > make > t

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Kevin Walzer
On 3/26/10 9:23 AM, Harishankar wrote: Have you people embraced Python 3.x or still with 2.5 or 2.6? I personally want to switch over but not too sure how many people are using 3.x as opposed to 2 so I want to keep my programs compatible for the majority. -- Hari Not yet. Some key libraries I

Re: python logging writes an empty file

2010-03-26 Thread Ovidiu Deac
> You set le level of your handler, but did not set the level of the logger > itself. > Replace file.setLevel(logging.INFO) by > logging.getLogger().setLevel(logging.INFO) > > Log events are matched versus the logger level 1st, then the handler level > (if applicable). Most of the time you don't ne

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Andrej Mitrovic
I use both, really. I started by learning and using Python 3, but I ended up using Python 2 much more often compared to Py3. Not because of the functionality of the language, but because most software that embeds Python or is extendable in some way is usually using Python 2. + There's the whole lib

Re: Traversing through Dir()

2010-03-26 Thread Andrej Mitrovic
On Mar 26, 9:18 am, "Alf P. Steinbach" wrote: > * Andrej Mitrovic: > > > I would like to traverse through the entire structure of dir(), and > > write it to a file. > > > Now, if I try to write the contents of dir() to a file (via pickle), I > > only get the top layer. So even if there are lists w

Re: [python3]

2010-03-26 Thread Kevin Adams
On Mar 19, 3:02 pm, Terry Reedy wrote: > On 3/19/2010 2:17 PM, Steve Holden wrote: > > > > > Kevin Adams wrote: > >> Greetings! > > >> Please forgive me if im posting this to the wrong group. > > >> I'm new to Python, learning Python3 from the O'rielly "Learning > >> Python" book.  Reading > >> ab

Re: python logging writes an empty file

2010-03-26 Thread Jean-Michel Pichavant
Ovidiu Deac wrote: Then I tried this: file = logging.FileHandler(logFileBasename, 'w') file.setLevel(logging.INFO) # set a format which is simpler for console use formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s',) # tell the handler to use th

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Shashwat Anand
2.6.x is what most applications rely on. It is still too early for python 3 On Fri, Mar 26, 2010 at 6:59 PM, Alex Hall wrote: > Because of compatibility, and many modules being built for 2.6 only, I > am still on 2.6.4 (updating to .5 soon). > > On 3/26/10, Harishankar wrote: > > Have you peopl

Re: OT: Meaning of "monkey"

2010-03-26 Thread Shashwat Anand
evolved monkey = human (can relate codemonkey to it) 2010/3/26 Kushal Kumaran > > 2010/3/26 Luis M. González : > > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, > > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > > > Monkeys everywhere. > > Sorry fo

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Neil Cerutti
On 2010-03-26, Harishankar wrote: > Have you people embraced Python 3.x or still with 2.5 or 2.6? > > I personally want to switch over but not too sure how many > people are using 3.x as opposed to 2 so I want to keep my > programs compatible for the majority. I switched 6 months ago, or so. My

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Alex Hall
Because of compatibility, and many modules being built for 2.6 only, I am still on 2.6.4 (updating to .5 soon). On 3/26/10, Harishankar wrote: > Have you people embraced Python 3.x or still with 2.5 or 2.6? > > I personally want to switch over but not too sure how many people are > using 3.x as o

Re: OT: Meaning of "monkey"

2010-03-26 Thread Kushal Kumaran
2010/3/26 Luis M. González : > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > Monkeys everywhere. > Sorry for the off topic question, but what does "monkey" mean in a > nerdy-geek context?? > These migh

Have you embraced Python 3.x yet?

2010-03-26 Thread Harishankar
Have you people embraced Python 3.x or still with 2.5 or 2.6? I personally want to switch over but not too sure how many people are using 3.x as opposed to 2 so I want to keep my programs compatible for the majority. -- Hari -- http://mail.python.org/mailman/listinfo/python-list

OT: Meaning of "monkey"

2010-03-26 Thread Luis M . González
Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... Monkeys everywhere. Sorry for the off topic question, but what does "monkey" mean in a nerdy-geek context?? Luis -- http://mail.python.org/mailman/listinfo/pyt

Re: sqlite version on windows

2010-03-26 Thread Philip Semanchuk
On Mar 26, 2010, at 5:57 AM, Laszlo Nagy wrote: Hi All, On my Linux system: Python version: 2.6.2 sqlite3.sqlite_version: 3.6.10 On my Windows system: Python version: 2.6.5 sqlite3.sqlite_version: 3.5.9 Why is that? I wrote a program that uses SAVEPOINT/ROLLBACK to. It is only availa

Re: Automatic import ?

2010-03-26 Thread Jean-Michel Pichavant
C. B. wrote: Hi everyone, I'm currently coding a C library which provides several modules and objects. Let's say that some of these objects are classes called AAA and BBB. The constructor of AAA needs to get BBB as argument. So I can run the following code : from mymodule import AAA from mymo

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Steve Holden
Winston wrote: [...] > This new syntax for a generator will break all existing > programs. But we happen to be at the start of Python 3K where > new paradaigms are > being examined. However good your idea may be, I suspect this one sentence will kill it. We are no longer "at the s

Re: Automatic import ?

2010-03-26 Thread Ovidiu Deac
> But, as there is no case where AAA can be used without BBB, I would > like to avoid importing BBB in my Python scripts when I already import > AAA. Then why do you need to explicitely pass BBB() to AAA constructor? You could leave AAA constructor with no parameters or with a parameter with a def

Re: sqlite version on windows

2010-03-26 Thread Laszlo Nagy
2010.03.26. 10:57 keltezéssel, Laszlo Nagy írta: Hi All, On my Linux system: Python version: 2.6.2 sqlite3.sqlite_version: 3.6.10 On my Windows system: Python version: 2.6.5 sqlite3.sqlite_version: 3.5.9 Why is that? I wrote a program that uses SAVEPOINT/ROLLBACK to. It is only available in

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread James Harris
On 26 Mar, 10:04, Harishankar wrote: ... > > Think of the database as similar to an associative array stored on > > disk. The only difference is I may want to play fast and loose with > > the keys in some ways - e.g. check for partial key matches or return a > > list of part-matched keys. The lang

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread Harishankar
On Fri, 26 Mar 2010 02:49:53 -0700 (PDT) James Harris wrote: > On 25 Mar, 22:56, Jon Clements wrote: > > On 25 Mar, 22:40, James Harris > > wrote: > > > > > I am looking to store named pieces of text in a form that can be > > > edited by a standard editor such as notepad (under Windows) or vi >

sqlite version on windows

2010-03-26 Thread Laszlo Nagy
Hi All, On my Linux system: Python version: 2.6.2 sqlite3.sqlite_version: 3.6.10 On my Windows system: Python version: 2.6.5 sqlite3.sqlite_version: 3.5.9 Why is that? I wrote a program that uses SAVEPOINT/ROLLBACK to. It is only available in SQLite 3.6.8 and above. Can I install it on Windo

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread James Harris
On 25 Mar, 22:56, Jon Clements wrote: > On 25 Mar, 22:40, James Harris wrote: > > > I am looking to store named pieces of text in a form that can be > > edited by a standard editor such as notepad (under Windows) or vi > > (under Unix) and then pulled into Python as needed. The usual record > > l

Re: Python database of plain text editable by notepad or vi

2010-03-26 Thread Almar Klein
Hi, On 25 March 2010 23:40, James Harris wrote: > I am looking to store named pieces of text in a form that can be > edited by a standard editor such as notepad (under Windows) or vi > (under Unix) and then pulled into Python as needed. The usual record > locking and transactions of databases ar

Re: Advanced Python Programming Oxford Lectures [was: Re: *Advanced* Python book?]

2010-03-26 Thread Michele Simionato
On Mar 25, 2:24 pm, Michele Simionato wrote: > On Mar 25, 1:28 pm, Ethan Furman wrote: > > > > > Michele, > > > Was wondering if you'd had a chance to re-post your lectures -- just did > > a search for them and came up empty, and I would love to read them! > > > Many thanks in advance! > > Oops,

Re: Traversing through Dir()

2010-03-26 Thread Alf P. Steinbach
* Andrej Mitrovic: I would like to traverse through the entire structure of dir(), and write it to a file. Now, if I try to write the contents of dir() to a file (via pickle), I only get the top layer. So even if there are lists within the returned list from dir(), they get written as a list of

Re: Automatic import ?

2010-03-26 Thread C. B.
> > What is the behaviour of the __init__.py file? > Not yet used, but I read this file is run by Python when a module of a package is imported. So you can insert default importations in it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Improved timedelta attributes/methods

2010-03-26 Thread Kushal Kumaran
2010/3/26 Christian Ştefănescu : > Hello dear Python-wielding developers! > > I generally like date/time handling in Python very much, especially how date > operations result in Timedelta objects. But I find it somewhat impractical, > that you can only get days, seconds and microseconds out of a ti