ANN: eGenix mxODBC and mxODBC Zope DA on 64-bit FreeBSD

2007-09-12 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Database Interface eGenix.com mxODBC Zope Database Adapter for 64-bit FreeBSD This announcement is also available on our web-site for

Re: Python Problem

2007-09-12 Thread A.T.Hofkamp
On 2007-09-11, Wiseman [EMAIL PROTECTED] wrote: Hi, OK - it works in WindowsXP. I installed enchant on my SuSE 10.0 (using YAST). The enchant Suse package looks like a general Linux package, not a Python specific. You'd seem to be right judging by this web-page:

Re: Get the complete command line as-is

2007-09-12 Thread Laurent Pointal
wangzq a écrit : Hello, I'm passing command line parameters to my browser, I need to pass the complete command line as-is, for example: test.py abc def xyz If I use ' '.join(sys.argv[1:]), then the double quotes around abc def is gone, but I need to pass the complete command line (abc

An ordered dictionary for the Python library?

2007-09-12 Thread Mark Summerfield
I feel that Python lacks one useful data structure: an ordered dictionary. I find such data structures v. useful in C++. I know that in Python the sort function is v. fast, but often I prefer never to sort but simply to use an ordered data structure in the first place. (I'm aware that for ordered

Re: Python Problem

2007-09-12 Thread Marc 'BlackJack' Rintsch
On Wed, 12 Sep 2007 09:09:02 +0200, A.T.Hofkamp wrote: On 2007-09-11, Wiseman [EMAIL PROTECTED] wrote: Hi, OK - it works in WindowsXP. I installed enchant on my SuSE 10.0 (using YAST). The enchant Suse package looks like a general Linux package, not a Python specific. You'd seem to

Re: Generating HTML

2007-09-12 Thread Evan Klitzke
On Wed, 2007-09-12 at 01:33 -0300, Sebastian Bassi wrote: Hello, What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from Python. It's not

Re: Python 3K or Python 2.9?

2007-09-12 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : Python user and advocate Bruce Eckel is disappointed with the additions (or lack of additions) in Python 3: http://www.artima.com/weblogs/viewpost.jsp?thread=214112 I'd say Mr Eckel fails to graps some of the great points about Python's object model - the rant

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Michele Simionato
On Sep 12, 9:33 am, Mark Summerfield [EMAIL PROTECTED] wrote: I feel that Python lacks one useful data structure: an ordered dictionary. I find such data structures v. useful in C++. I know that in Python the sort function is v. fast, but often I prefer never to sort but simply to use an

Re: __getattr__ and static vs. instantiated

2007-09-12 Thread Bruno Desthuilliers
tvaughan a écrit : Hi, Let's say I have: class Persistable(object): __attrs__ = {} def __getattr__(self, name): if name in self.__attrs__: return self.__attrs__[name]['value'] else:

Re: An ordered dictionary for the Python library?

2007-09-12 Thread stef
Mark Summerfield wrote: I feel that Python lacks one useful data structure: an ordered dictionary. I find such data structures v. useful in C++. I know that in Python the sort function is v. fast, but often I prefer never to sort but simply to use an ordered data structure in the first

Re: Generating HTML

2007-09-12 Thread Bruno Desthuilliers
Evan Klitzke a écrit : On Wed, 2007-09-12 at 01:33 -0300, Sebastian Bassi wrote: Hello, What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from

How can I work on VIM for python code such as cscope for C code?

2007-09-12 Thread Evan
Hi, guys ~~ How can i work on VIM for python code? I use cscope plugin on VIM for C code before, it helps me to different function and search C variable where it is defined. I'm now starting to learn python, and I'd like to know how works on VIM. I saw that the VIM is support python such as

Re: Help With PyParsing of output from win32pdhutil.ShowAllProcesses()

2007-09-12 Thread Paul McGuire
On Sep 11, 1:12 pm, Steve [EMAIL PROTECTED] wrote: Hi All (especially Paul McGuire!) Could you lend a hand in the grammar and paring of the output from the function win32pdhutil.ShowAllProcesses()? This is the code that I have so far (it is very clumsy at the moment) : snip Many thanks!

Re: Excel process still running after program completion - SOLVED

2007-09-12 Thread Tal Einat
On Sep 11, 8:29 pm, Chris [EMAIL PROTECTED] wrote: On Sep 11, 1:26 pm, Chris [EMAIL PROTECTED] wrote: On Sep 11, 12:59 pm, Hamilton, William [EMAIL PROTECTED] wrote: From: Chris I have a python script that is driving Excel and using the win32com module. However, upon program

Re: Difference between two times (working ugly code, needs polish)

2007-09-12 Thread Iain King
On Sep 12, 1:31 am, Shawn Milochik [EMAIL PROTECTED] wrote: I suppose really oneDay should be a global (i.e. outside the function definition). Apart from that it would be hard to improve on: obvious, easy to read, in short - pythonic. Are you concerned about daylight savings? That could

setattr vs readonly property

2007-09-12 Thread james_027
hi, My main purpose for using setattr(object, attr, value) for assign values from a dict that has some keys that may not be present on some object's attibute, which makes it work for me. My problem is dealing with read only attribute like sample_attribute = property(f_get=_get_sample_attribute).

Re: need scsh in a wikip article

2007-09-12 Thread [EMAIL PROTECTED]
someone please add scsh there. Why can't YOU add scsh or I am missing something?? Andrey -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr vs readonly property

2007-09-12 Thread Diez B. Roggisch
james_027 wrote: hi, My main purpose for using setattr(object, attr, value) for assign values from a dict that has some keys that may not be present on some object's attibute, which makes it work for me. My problem is dealing with read only attribute like sample_attribute =

Re: Get Only the Last Items in a Traceback

2007-09-12 Thread Peter Otten
Am Wed, 12 Sep 2007 02:09:28 + schrieb [EMAIL PROTECTED]: I'm running code via the exec in context statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python interactive interpreter does, but only show

MemoryError on reading mbox file

2007-09-12 Thread Christoph Krammer
Hello everybody, I have to convert a huge mbox file (~1.5G) to MySQL. I tried with the following simple code: for m in mailbox.mbox(fileName): msg = m.as_string(True) hash = md5.new(msg).hexdigest() try: dbcurs.execute(INSERT INTO archive (hash, msg) VALUES (%s, %s), (hash, msg))

Re: need scsh in a wikip article

2007-09-12 Thread Timofei Shatrov
On Wed, 12 Sep 2007 02:10:09 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] tried to confuse everyone with this message: someone please add scsh there. Why can't YOU add scsh or I am missing something?? Maybe he is banned? -- |Don't believe this - you're not worthless

Re: Generating HTML

2007-09-12 Thread Diez B. Roggisch
Sebastian Bassi wrote: Hello, What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from Python. KID, Genshi, Mako. And a bazillion others. I prefer

Re: function to do dynamic import?

2007-09-12 Thread Peter Otten
Am Wed, 12 Sep 2007 11:54:51 +1000 schrieb bambam: def gim(): exec global gamel exec import gamel Unfortunately, does not have the desired effect. Steve. Both statements have to be part of a single exec: def gim(): modulename = gamel # determined at runtime exec global

Re: Get Only the Last Items in a Traceback

2007-09-12 Thread Michael Ströder
[EMAIL PROTECTED] wrote: I'm running code via the exec in context statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python interactive interpreter does, but only show the part of the traceback relating to

Re: setattr vs readonly property

2007-09-12 Thread David
My main purpose for using setattr(object, attr, value) for assign values from a dict that has some keys that may not be present on some object's attibute, which makes it work for me. My problem is dealing with read only attribute like sample_attribute = property(f_get=_get_sample_attribute).

Re: MemoryError on reading mbox file

2007-09-12 Thread David
My system has 512M RAM and 768M swap, which seems to run out at an early stage of this. Is there a way to clean up memory for messages already processed? It may be that Python's garbage collection isn't keeping up with your app. You could try periodically forcing it to run. eg: import gc

newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Charles Fox
I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like neurons) described mathematically in papers, by equations like

Re: An ordered dictionary for the Python library?

2007-09-12 Thread thebjorn
On Sep 12, 9:33 am, Mark Summerfield [EMAIL PROTECTED] wrote: I feel that Python lacks one useful data structure: an ordered dictionary. I find such data structures v. useful in C++. I know that in Python the sort function is v. fast, but often I prefer never to sort but simply to use an

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread David
Please help if I am missing something -- this looks like a great language but I am going to mad trying to read numerical code full of 'self.'s breaking up the equations. You could try this in your functions: s = self Then you can use code like this: s.a_dot = s.k(s.a-s.u) Another option, if

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Michele Simionato
On Sep 12, 12:21 pm, Charles Fox [EMAIL PROTECTED] wrote: I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like

Re: Python 3K or Python 2.9?

2007-09-12 Thread Ivan Voras
Bruno Desthuilliers wrote: TheFlyingDutchman a écrit : Python user and advocate Bruce Eckel is disappointed with the additions (or lack of additions) in Python 3: http://www.artima.com/weblogs/viewpost.jsp?thread=214112 I'd say Mr Eckel fails to graps some of the great points about Python's

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread David
On 9/12/07, David [EMAIL PROTECTED] wrote: Please help if I am missing something -- this looks like a great language but I am going to mad trying to read numerical code full of 'self.'s breaking up the equations. You could try this in your functions: s = self Then you can use code like

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Diez B. Roggisch
with self: .a_dot = -.k(.a-.u) It's premature to make language suggestions as I am new to the language, but I would have though that making a 'with self' explicit in all methods would have been neat, so I could just write .a_dot = -.k(.a-.u) which would still avoid

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Bruno Desthuilliers
Charles Fox a écrit : I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like neurons) described mathematically in

Re: Difference between two times (working ugly code, needs polish)

2007-09-12 Thread Shawn Milochik
Just to be picky - your function returns the number of days between two dates, but it's called isOld, which looks like it should return a boolean. i.e. it looks like it would be used as: if not isOld(auctionDate, currentTime): checkForBid() rather than how I assume it is used: if

Re: Generating HTML

2007-09-12 Thread jkn
I used to use Cheetah, but have switched recently to Jinja: http://jinja.pocoo.org/ Mainly this is because the syntax is similar to Django's templates, and eventually I plan on migrating to Django. jon N -- http://mail.python.org/mailman/listinfo/python-list

RE: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Ryan Ginstrom
On Behalf Of Charles Fox described mathematically in papers, by equations like a_dot = -k(a-u) In other languages, this translates nicely into code, but as far as I can tell, Python needs the ugly: self.a_dot = -self.k(self.a-self.u) In addition to the other advice you've received,

Re: unexpected behavior: did i create a pointer?

2007-09-12 Thread Bruno Desthuilliers
neoedmund a écrit : On Sep 7, 4:07 pm, gu [EMAIL PROTECTED] wrote: (snip pb and code) now, in the second for cycle and in functionA() i only 'touch' copyOfA (altering it). as i don't touch the variable a, i expect it not to be affected by any change, but copyOfA acts like a pointer to a and

Re: Python 3K or Python 2.9?

2007-09-12 Thread Bjoern Schliessmann
Ivan Voras wrote: What does self have to do with an object model? It's an function/method argument that might as well be hidden in the compiler without ever touching the role it has (if not, why?). I agree that it's needless noise in a language. If this was needless, why do C++ and Java have

Re: Compiler Python

2007-09-12 Thread Bjoern Schliessmann
Bruno Desthuilliers wrote: Bjoern Schliessmann a écrit : I'm not really about the syntax of your question, ^(sure) lol !-) ;) It wasn't mean ironically, I really forgot the sure. Regards, Björn -- BOFH excuse #322: Your Pentium has a heating problem - try cooling it

Sea-or-land test

2007-09-12 Thread kpalamartchouk
Could you advise if there exists a simple package, containing function that would take geographic coordinates and return information on whether this point belongs to land or sea? No great accuracy is needed -- I am interested in just major features, like those seen on coarse world maps. --

Re: How can I work on VIM for python code such as cscope for C code?

2007-09-12 Thread Joe Riopel
On 9/12/07, Evan [EMAIL PROTECTED] wrote: Hi, guys ~~ How can i work on VIM for python code? I use cscope plugin on VIM for C code before, it helps me to different function and search C variable where it is defined. Change to the top level directory that contains your python source files,

Re: Get Only the Last Items in a Traceback

2007-09-12 Thread Peter Otten
Am Wed, 12 Sep 2007 11:21:48 +0200 schrieb Michael Ströder: [EMAIL PROTECTED] wrote: I'm running code via the exec in context statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python interactive

Re: cpython list __str__ method for floats

2007-09-12 Thread Bjoern Schliessmann
[david] wrote: Leaving aside the question of why str should return repr, str doesn't return repr. str returns a nice string representation of an object. This nice string representation of a list is the opening square bracket, the repr of its contents seperated by comma, and the closing square

SIP examples

2007-09-12 Thread Srijit Kumar Bhadra
I am trying to learn SIP (http://www.riverbankcomputing.co.uk/sip/) these days. I do not see any examples similar to SWIG. http://www.swig.org/doc.html has lots of examples. But for SIP, all I see is a reference guide (http://www.riverbankcomputing.com/Docs/sip4/sipref.html). Examples help. Where

Re: Generating HTML

2007-09-12 Thread Walter Dörwald
Sebastian Bassi wrote: Hello, What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from Python. If you want something that works similar to HTMLgen,

Re: Python 3K or Python 2.9?

2007-09-12 Thread Stefan Behnel
Bjoern Schliessmann wrote: What does self have to do with an object model? It's an function/method argument that might as well be hidden in the compiler without ever touching the role it has (if not, why?). I agree that it's needless noise in a language. If this was needless, why do C++ and

Re: Generating HTML

2007-09-12 Thread Stefan Behnel
Sebastian Bassi wrote: What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from Python. There's also lxml.html, which has straight forward support for

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Jeremy Sanders
Charles Fox wrote: I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like neurons) described mathematically in

Spring Python 0.3.0 is released!

2007-09-12 Thread Goldfish
Spring Python (http://springpython.python-hosting.com) version 0.3.0 was released yesterday. Key improvements include: * Make the web components WSGI-compatible, firstly working with CherryPy. * Extend PetClinic to use database accounts and have password encoding. * Add an

Re: Python Database Apps

2007-09-12 Thread Ed Leafe
On Sep 11, 2007, at 2:56 PM, [EMAIL PROTECTED] wrote: It's gonna be a desktop app. The database engine is going to be the critical component. I like sqlite so that I don't need a database server on the client side. It would help though if there is a way to sync between multiple clients to

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Steven D'Aprano
On Wed, 12 Sep 2007 03:21:58 -0700, Charles Fox wrote: I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like

Re: Python 3K or Python 2.9?

2007-09-12 Thread Duncan Booth
Ivan Voras [EMAIL PROTECTED] wrote: I'd say Mr Eckel fails to graps some of the great points about Python's object model - the rant about the use of 'self' is a sure clue. What does self have to do with an object model? It's an function/method argument that might as well be hidden in

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Steven D'Aprano
On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: I feel that Python lacks one useful data structure: an ordered dictionary. I find such data structures v. useful in C++. [snip] Personally, I've never missed an ordered dict. What do people use them for? In fact, I'm not sure

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Michele Simionato
On Sep 12, 2:42 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: In fact, I'm not sure what people mean by ordered dicts. I assume they mean the keys are ordered, not the values. But ordered by what? Insertion order?

Re: SIP examples

2007-09-12 Thread Diez B. Roggisch
Srijit Kumar Bhadra wrote: I am trying to learn SIP (http://www.riverbankcomputing.co.uk/sip/) these days. I do not see any examples similar to SWIG. http://www.swig.org/doc.html has lots of examples. But for SIP, all I see is a reference guide

Re: Python Database Apps

2007-09-12 Thread Goldfish
I use MySQL and also sqlite. However, I also use Spring Python (http:// springpython.python-hosting.com) to use both its DatabaseTemplate utility class and also the remoting functionality. This way, I can have the database code sitting on the server, and then export the data access functions

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Steven D'Aprano
On Wed, 12 Sep 2007 09:51:02 +0200, stef wrote: If you're going to extend the dictionary, there's one other flag I'm continuously missing: case-insensitive key. Completely untested and probably buggy as anything, but here's an absolutely minimal case-insensitive dictionary. class

Re: cpython list __str__ method for floats

2007-09-12 Thread Duncan Booth
Bjoern Schliessmann [EMAIL PROTECTED] wrote: The idea that 13.3 is a 'rounded' value for the number, and that 13.301 is not a 'rounded' value of the number, is a common error of intuitive mathematics. I'm intrigued how /you/'d explain this, please do explain. I think he is

pythonesque constructs for c++

2007-09-12 Thread Josh
One of the best features of python is its ease of use, and the ease of use of its modules. Modules like os, os.path, and datetime are invaluable! Does anyone know of analagous c++ libraries? It seems to me that most of the functionality of these modules could easily be replicated in c++. Before

Is the wxPython list down?

2007-09-12 Thread kyosohma
Hi, Does anyone know if the wxPython mailing list is having issues? I subscribe to it and haven't seen anything come through since 09/06/2007. I went to ActiveState's archives and the last message there is from the 7th (http://aspn.activestate.com/ASPN/Mail/Browse/ Threaded/wxPython-users).

Re: Basic GUI

2007-09-12 Thread kyosohma
Don, On Sep 11, 10:54 pm, Don Hanlen [EMAIL PROTECTED] wrote: I'm writing a simple GUI that: ..gets info via telnet protocol (and sends) ..gets info via http (and sends) ..gets user-info from (currently) ...Tkinter Text windoze ...Tkinter buttons and such

Re: Sea-or-land test

2007-09-12 Thread kyosohma
On Sep 12, 6:54 am, [EMAIL PROTECTED] wrote: Could you advise if there exists a simple package, containing function that would take geographic coordinates and return information on whether this point belongs to land or sea? No great accuracy is needed -- I am interested in just major features,

Re: encoding latin1 to utf-8

2007-09-12 Thread Harshad Modi
thx for response , i think, my file has wrong encoding format. thanks for guide and advise -- http://mail.python.org/mailman/listinfo/python-list

Re: Is the wxPython list down?

2007-09-12 Thread stef
[EMAIL PROTECTED] wrote: Hi, Does anyone know if the wxPython mailing list is having issues? I Yes the server has hardware problems, Robin Dunn (moderator), is informed about it. cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Is the wxPython list down?

2007-09-12 Thread Frank Millman
On Sep 12, 3:10 pm, [EMAIL PROTECTED] wrote: Hi, Does anyone know if the wxPython mailing list is having issues? I subscribe to it and haven't seen anything come through since 09/06/2007. I went to ActiveState's archives and the last message there is from the 7th

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Dave Hansen
On Sep 12, 5:21 am, Charles Fox [EMAIL PROTECTED] wrote: I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like

Re: library to launch program in linux

2007-09-12 Thread idzwan . nizam
On Sep 7, 2:49 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-09-06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm a new user. What library should I use so that I canlaunch programin linux using python? Thank you in advance. subprocess -- Grant Edwards grante

Re: pythonesque constructs for c++

2007-09-12 Thread Szabolcs Horvát
Josh wrote: One of the best features of python is its ease of use, and the ease of use of its modules. Modules like os, os.path, and datetime are invaluable! Does anyone know of analagous c++ libraries? It seems to me that most of the functionality of these modules could easily be

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Mark Summerfield
On 12 Sep, 13:46, Michele Simionato [EMAIL PROTECTED] wrote: On Sep 12, 2:42 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: In fact, I'm not sure what people mean by ordered dicts. I assume they mean the keys are

Re: Is the wxPython list down?

2007-09-12 Thread kyosohma
On Sep 12, 8:26 am, stef [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi, Does anyone know if the wxPython mailing list is having issues? I Yes the server has hardware problems, Robin Dunn (moderator), is informed about it. cheers, Stef Mientki And to think, we're always told

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Michele Simionato
On Sep 12, 3:54 pm, Mark Summerfield [EMAIL PROTECTED] wrote: On 12 Sep, 13:46, Michele Simionato [EMAIL PROTECTED] Actually I meant by key order, so insertion order doesn't matter at all. If you need a dictionary-like data structure that respects insertion order you could use a list of (key,

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Bruno Desthuilliers
Dave Hansen a écrit : (snip) As others have mentioned, you can also provide local synonyms if the dot syntax is too onerous. But make sure you use the member access syntax if the result of an expression is an immutable type. For example, I assume a_dot is a mutable type, such as a list. If

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Duncan Booth
Steven D'Aprano [EMAIL PROTECTED] wrote: In fact, I'm not sure what people mean by ordered dicts. I assume they mean the keys are ordered, not the values. But ordered by what? Insertion order? Modification order? Alphabetical order? All of the above at different times. Usually I think they

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Roel Schroeven
Michele Simionato schreef: On Sep 12, 2:42 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: In fact, I'm not sure what people mean by ordered dicts. I assume they mean the keys are ordered, not the values. But ordered

Re: MemoryError on reading mbox file

2007-09-12 Thread Christoph Krammer
On 12 Sep., 12:20, David [EMAIL PROTECTED] wrote: It may be that Python's garbage collection isn't keeping up with your app. You could try periodically forcing it to run. eg: import gc gc.collect() I tried this, but the problem is not solved. When invoking the garbage collection after every

Dynamically removing methods in new-style classes

2007-09-12 Thread agupta0318
I am trying unsuccessfully to remove some methods from an instance, based on values passed in to the constructor as in the following example: #=== class A(object): def __init__(self, id): self._id = id

Re: library to launch program in linux

2007-09-12 Thread Grant Edwards
On 2007-09-12, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm a new user. What library should I use so that I canlaunch programin linux using python? Thank you in advance. can you please show me the sample code using subprocess library. http://docs.python.org/lib/module-subprocess.html I

Re: MemoryError on reading mbox file

2007-09-12 Thread Hrvoje Niksic
Christoph Krammer [EMAIL PROTECTED] writes: I have to convert a huge mbox file (~1.5G) to MySQL. Have you tried commenting out the MySQL portion of the code? Does the code then manage to finish processing the mailbox? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamically removing methods in new-style classes

2007-09-12 Thread Hrvoje Niksic
[EMAIL PROTECTED] writes: I am trying unsuccessfully to remove some methods from an instance, You can't remove the method from an instance because the method is stored in its class. With the older python classes I could have done: self.__class__.__dict__[''test1] to achieve the desired

Re: Python Database Apps

2007-09-12 Thread [EMAIL PROTECTED]
On Sep 12, 8:39 am, Ed Leafe [EMAIL PROTECTED] wrote: On Sep 11, 2007, at 2:56 PM, [EMAIL PROTECTED] wrote: It's gonna be a desktop app. The database engine is going to be the critical component. I like sqlite so that I don't need a database server on the client side. It would help

Re: Dynamically removing methods in new-style classes

2007-09-12 Thread Michele Simionato
On Sep 12, 4:28 pm, [EMAIL PROTECTED] wrote: I am trying unsuccessfully to remove some methods from an instance, Usuall one does not remove methods, but wraps the object and delegates only to a restricted number of methods. Is this solution viable? If not, you may be forced to change the class

RE: An ordered dictionary for the Python library?

2007-09-12 Thread Hamilton, William
From: Michele Simionato On Sep 12, 3:54 pm, Mark Summerfield [EMAIL PROTECTED] wrote: On 12 Sep, 13:46, Michele Simionato [EMAIL PROTECTED] Actually I meant by key order, so insertion order doesn't matter at all. If you need a dictionary-like data structure that respects insertion

Re: MemoryError on reading mbox file

2007-09-12 Thread Istvan Albert
On Sep 12, 5:27 am, Christoph Krammer [EMAIL PROTECTED] wrote: string = self._file.read(stop - self._file.tell()) MemoryError This line reads an entire message into memory as a string. Is it possible that you have a huge email in there (hundreds of MB) with some attachment encoded as text?

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Charles Fox
Thanks guys -- yeah these two stategies (short s.varname; and explicit rescoping, a=self.a etc) are more or less what I was using. That's still kind of annoying though. The s.varname approach still makes numerical code much harder to read. I had a nasty bug with the boilerplate approach when

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Tim Golden
Charles Fox wrote: Thanks guys -- yeah these two stategies (short s.varname; and explicit rescoping, a=self.a etc) are more or less what I was using. That's still kind of annoying though. The s.varname approach still makes numerical code much harder to read. I had a nasty bug with the

Re: Get Only the Last Items in a Traceback

2007-09-12 Thread [EMAIL PROTECTED]
On Sep 12, 5:17 am, Peter Otten [EMAIL PROTECTED] wrote: Your assessment is wrong. You only get the extra lines in the traceback if you don't immediately wrap the exec statement in a try ... except block: $ cat snip_traceback1.py import traceback def alpha(): try: beta()

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Michele Simionato
On Sep 12, 4:43 pm, Charles Fox [EMAIL PROTECTED] wrote: Thanks guys -- yeah these two stategies (short s.varname; and explicit rescoping, a=self.a etc) are more or less what I was using. That's still kind of annoying though. The s.varname approach still makes numerical code much harder to

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Grant Edwards
On 2007-09-12, Tim Golden [EMAIL PROTECTED] wrote: I think it's one of those things which comes down, fairly enough, to: we do things this way and it works for us; other languages do other things and it works for them. But not as nearly well as our way works for us, of course. ;) -- Grant

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread J. Clifford Dyer
On Wed, Sep 12, 2007 at 07:43:51AM -0700, Charles Fox wrote regarding Re: newbie: self.member syntax seems /really/ annoying: Thanks guys -- yeah these two stategies (short s.varname; and explicit rescoping, a=self.a etc) are more or less what I was using. That's still kind of annoying

Re: Is the wxPython list down?

2007-09-12 Thread Chris Mellon
On 9/12/07, Frank Millman [EMAIL PROTECTED] wrote: On Sep 12, 3:10 pm, [EMAIL PROTECTED] wrote: Hi, Does anyone know if the wxPython mailing list is having issues? I subscribe to it and haven't seen anything come through since 09/06/2007. I went to ActiveState's archives and the last

ANN: eGenix mxODBC and mxODBC Zope DA on 64-bit FreeBSD

2007-09-12 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Database Interface eGenix.com mxODBC Zope Database Adapter for 64-bit FreeBSD This announcement is also available on our web-site for

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread kyosohma
Charles Fox wrote: I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like neurons) described mathematically in

Re: Enum class with ToString functionality

2007-09-12 Thread Neil Cerutti
On 2007-09-11, Steven D'Aprano [EMAIL PROTECTED] wrote: Perhaps Ben should have followed the usual practice of commercial, closed- source software developers and started counting his version numbers at one instead of zero, miss a few releases, use randomly large increments occasionally, and

Re: National grid to lat long conversion

2007-09-12 Thread Astley Le Jasper
Hi, I was a bit limited with time so in the end used an online service with an API which is great for the limited number of look-ups I needed. It can be found at: http://www.nearby.org.uk/ It was also very useful for site for other conversions and lookups. I manage to find a couple of other

is it possible to use different font within one wxpython static text widget?

2007-09-12 Thread hyena
problem is as title, bear me if this too silly or too naive. I use wx.statictext widget to show some information in GUI, there are some numbers in the text to be emphasized in bigger other color. For example, in sentence the travel speed of this car is 40 km /hour, I would like 40 to be bigger

Re: Python 3K or Python 2.9?

2007-09-12 Thread Alex Martelli
Duncan Booth [EMAIL PROTECTED] wrote: ... As for omitting 'self' from method definitions, at first site you might think the compiler could just decide that any 'def' directly inside a class could silently insert 'self' as an additional argument. This doesn't work though because not

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Chris Mellon
On 9/12/07, Charles Fox [EMAIL PROTECTED] wrote: Thanks guys -- yeah these two stategies (short s.varname; and explicit rescoping, a=self.a etc) are more or less what I was using. That's still kind of annoying though. The s.varname approach still makes numerical code much harder to read. I

Re: Get Only the Last Items in a Traceback

2007-09-12 Thread Peter Otten
Am Wed, 12 Sep 2007 15:09:02 + schrieb [EMAIL PROTECTED]: On Sep 12, 5:17 am, Peter Otten [EMAIL PROTECTED] wrote: Your assessment is wrong. You only get the extra lines in the traceback if you don't immediately wrap the exec statement in a try ... except block: $ cat snip_traceback3.py

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Chris Mellon
On 9/12/07, Mark Summerfield [EMAIL PROTECTED] wrote: On 12 Sep, 13:46, Michele Simionato [EMAIL PROTECTED] wrote: On Sep 12, 2:42 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: In fact, I'm not sure what

  1   2   3   >