ANN: xxgamma 0.06

2009-03-19 Thread Florian Diesch
I'm happy to announce xxgamma 0.06 Get it at http://www.florian-diesch.de/software/xxgamma/ xxgamma is an PyGTK based GUI for xgamma which allows you to load, modify and store multiple gamma correction profiles for XFree86 and X.org through a GUI and a command line interface. Version 0.06

ANN: pycairo release 1.8.4 now available

2009-03-19 Thread Steve
Pycairo is a set of Python bindings for the multi-platform 2D graphics library cairo. http://cairographics.org http://cairographics.org/pycairo A new pycairo release 1.8.4 is now available from: http://cairographics.org/releases/pycairo-1.8.4.tar.gz

ANN: eGenix mxODBC Connect 1.0.1 - Python Database Interface

2009-03-19 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 1.0.1 Our new client-server product for connecting Python applications

pylab plot_date problem

2009-03-19 Thread Shah Sultan Alam
Hi , I am using following code to create a graph def plot_plot(): ax = pylab.subplot(111) for count in range(len(yaxes_values)): pylab.subplots_adjust(left=0.13, bottom=0.21, right=0.90, top=0.90,wspace=0.20, hspace=0.20)

Re: [python-list] Re: Strange crash issue on Windows w/ PyGTK, Cairo...

2009-03-19 Thread CJ Kucera
bieff...@gmail.com wrote: If you have worked with C/C++, you know that memory-related bugs can be very tricky. More than once - working with C code - I had crashes that disappeared if I just added a 'printf', because the memory allocation scheme changed and the memory corrupted was not

Re: How complex is complex?

2009-03-19 Thread Daniel Fetchinson
When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the dictionary. So, should we do: for key in a: ... a[key] = a[key] + 1 or is it

what does 64-bit python mean?

2009-03-19 Thread srinivasan srinivas
Hi, Could someone help me in understanding what 64-bit python means? tahnks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Re: equivalent of source command in tcl for python

2009-03-19 Thread alex23
On Mar 19, 2:42 pm, Ralf Schoenian r...@schoenian-online.de wrote: mark.coll...@csiro.au wrote: Many times I am developing a code in a file and I want to, for example, exit at a specific line so that I can test something. In tcl you can just put an exit command in and source the file. Is

Re: what does 64-bit python mean?

2009-03-19 Thread Chris Rebert
On Wed, Mar 18, 2009 at 11:45 PM, srinivasan srinivas sri_anna...@yahoo.co.in wrote: Hi, Could someone help me in understanding what 64-bit python means? It's been compiled for 64-bit processors, so it uses 64-bit pointers and 64-bit small integers. And I would think it would only work w/ C

Re: what does 64-bit python mean?

2009-03-19 Thread Christian Heimes
Chris Rebert wrote: It's been compiled for 64-bit processors, so it uses 64-bit pointers and 64-bit small integers. And I would think it would only work w/ C extension libraries also compiled for 64-bit CPUs. So, the same meaning 64-bit has for anything else really. A 64bit build of Python

Re: what does 64-bit python mean?

2009-03-19 Thread Martin v. Löwis
Could someone help me in understanding what 64-bit python means? While Chris' answer is correct, it doesn't show the consequences of using a 64-bit Python. Primarily, these are: - strings, Unicode objects, lists, dicts, and tuples can have more than 2**31 elements. - you can load 64-bit DLLs

Re: REDIRECT

2009-03-19 Thread Jeremiah Dodds
On Thu, Mar 19, 2009 at 4:30 AM, gaeasian...@gmail.com wrote: On Mar 18, 5:21 am, Tino Wildenhain t...@wildenhain.de wrote: gaeasian...@gmail.com wrote: 3. GoogleAppEngine, Version 1.1.9 (webapp - framework) What actually I'm try to do is : I'm having a Login page which developed in

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Peter Otten
Anthra Norell wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute read-writes. In C++, I suppose, a three-level inheritance would resolve into

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Chris Rebert
On Wed, Mar 18, 2009 at 6:09 AM, Anthra Norell anthra.nor...@bluewin.ch wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute read-writes. In C++, I

Re: How complex is complex?

2009-03-19 Thread Kottiyath
On Mar 19, 11:29 am, Daniel Fetchinson fetchin...@googlemail.com wrote: When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Christian Heimes
Chris Rebert wrote: There's no effect on attribute read-writes as they all take place within the single __dict__ of the instance. As for method lookup, it doesn't add an indirection per se, but rather the list of classes to look thru to find a method gets longer, making base-class method

Re: Roulette wheel

2009-03-19 Thread mattia
Il Wed, 18 Mar 2009 23:31:09 -0200, Gabriel Genellina ha scritto: En Wed, 18 Mar 2009 18:49:19 -0200, mattia ger...@gmail.com escribió: Il Wed, 18 Mar 2009 13:20:14 -0700, Aahz ha scritto: In article 49c1562a$0$1115$4fafb...@reader1.news.tin.it, mattia ger...@gmail.com wrote: Yeah, and I

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Peter Otten
Peter Otten wrote: Anthra Norell wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute read-writes. In C++, I suppose, a three-level

Re: How complex is complex?

2009-03-19 Thread Jeremiah Dodds
On Thu, Mar 19, 2009 at 9:39 AM, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. -- http://mail.python.org/mailman/listinfo/python-list I didn't think it was a foolish question, just

Re: read web page that requires javascript on client

2009-03-19 Thread Jeremiah Dodds
On Thu, Mar 19, 2009 at 1:25 AM, Carl tg2.u...@gmail.com wrote: Probably the easiest thing is to actually use a browser. There are many examples of automating a browser via Python. So, you can programmatically launch the browser, point it to the JavaScript afflicted page, let the JS run and

Re: read web page that requires javascript on client

2009-03-19 Thread James Matthews
You can try and use wxpythons broswer to execute the javascript On Wed, Mar 18, 2009 at 10:01 PM, Greg gregsaundersem...@gmail.com wrote: Hello all, I've been trying to find a way to fetch and read a web page that requires javascript on the client side and it seems impossible. I've read

Re: python equivalent of java technologies

2009-03-19 Thread Jeremiah Dodds
On Tue, Mar 17, 2009 at 8:32 PM, Armin feng.sh...@gmail.com wrote: You could tell her to try Jython. In that, you can just use the Java implementations. :) Plus, you have things in Jython that Java doesn't :D -- Armin Moradi -- http://mail.python.org/mailman/listinfo/python-list

Unicode problem in ucs4

2009-03-19 Thread abhi
Hi, I have a C extension, which takes a unicode or string value from python and convert it to unicode before doing more operations on it. The skeleton looks like: static PyObject *unicode_helper( PyObject *self, PyObject *args){ PyObject *sampleObj = NULL; Py_UNICODE *sample =

Re: Style formating of multiline query, advise

2009-03-19 Thread someone
On Mar 19, 10:26 am, Marco Mariani ma...@sferacarta.com wrote: someone wrote: Also, for SQL, (A) why are you using nested joins?, and inner select produce smaller set which is then joined with other table, kind a optimization Did you time it? I've done some kind of a optimization that

Style formating of multiline query, advise

2009-03-19 Thread someone
Hi, what is good :) style for multiline queries to database? Is that one ok? query = SELECT * FROM ( SELECT a.columna, a.columnb, a.iso FROM all a WHERE (a.name = LOWER(%s)) ) AS c JOIN other as b on c.gid = b.id

Re: python equivalent of java technologies

2009-03-19 Thread Tim Hoffman
Oops , for RIA there is always pyjamas (gwt for python ;-) T On Mar 19, 7:52 pm, Tim Hoffman zutes...@gmail.com wrote: Hi Well zope has quite a few of these out of the box and have been around for a bit longer than some of the java options. Specifically persistence (ZODB persistence in

Re: split problem if the delimiter is inside the text limiter

2009-03-19 Thread M.-A. Lemburg
On 2009-03-19 00:30, Tim Chase wrote: Bruno Desthuilliers wrote: Tim Chase a écrit : (if your columns in your CSV happen to match the order of your INSERT statement, you can just use execute(sql, tuple(row)) Or more simply: cursor.execute(sql, row) that's always annoyed me with

problem with Pamie (textbox editing)

2009-03-19 Thread stanislav_ziak
Hi, I try to test web aplication with using of modul Pamie and I have next problem, when I edit any textbox or textarea and consequently press the button which works the data in this textbox, so this textbox returns into the state before editing, fof example: Let I have 3 textboxes: box1, box2

lipo: can't figure out the architecture type of

2009-03-19 Thread Vijayendra Bapte
Hi, I am getting an gcc compilation error while installing FSEvents (http://pypi.python.org/packages/source/p/pyobjc-framework-FSEvents/ pyobjc-framework-FSEvents-2.2b1.tar.gz) package on my Mac (OS X 10.4.11, Intel Core Duo 32 bit processor, Python2.6.1, gcc: i686-apple- darwin8-gcc-4.0.1) gcc

Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Anthra Norell
Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute read-writes. In C++, I suppose, a three-level inheritance would resolve into something like

Re: mxODBC (was split problem if the delimiter is inside the text limiter)

2009-03-19 Thread Tim Chase
DB-API 2.0 has cursor.executemany() to make this differentiation at the API level. mxODBC will lift this requirement in the next version, promised :-) glad to hear...will executemany() take an arbitrary iterable? My (albeit somewhat-antiquated) version balked at anything that wasn't a

Emulate a printf() C-statement in Python???

2009-03-19 Thread Mr. Z
I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d years old., %s, %d); In other words, printf() has a variable arguement list the we all know. I'm trying to do this in Python... class

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Chris Rebert
On Thu, Mar 19, 2009 at 2:54 AM, Christian Heimes li...@cheimes.de wrote: Chris Rebert wrote: There's no effect on attribute read-writes as they all take place within the single __dict__ of the instance. As for method lookup, it doesn't add an indirection per se, but rather the list of classes

ANN: eGenix mxODBC Connect 1.0.1 - Python Database Interface

2009-03-19 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 1.0.1 Our new client-server product for connecting Python applications

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Terry Reedy
Anthra Norell wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute read-writes. More potential search layers rather than pointer indirection.

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Chris Rebert
On Thu, Mar 19, 2009 at 5:43 AM, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d years old., %s, %d); In other words, printf() has a variable

Re: python equivalent of java technologies

2009-03-19 Thread Tim Hoffman
Hi Well zope has quite a few of these out of the box and have been around for a bit longer than some of the java options. Specifically persistence (ZODB persistence in zope is pretty much completely autmomatic) you can inplement web services with it (xmlrpc out of the box, though I assume you

Python-URL! - weekly Python news and links (Mar 19)

2009-03-19 Thread Gabriel Genellina
QOTW: In that case I fear Python will be far too simple ... You've been programming for way too long ... - Steve Holden http://groups.google.com/group/comp.lang.python/msg/b8027713e674ef9d Having a function called after the constructor/__init__ is done:

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Andrii V. Mishkovskyi
On Thu, Mar 19, 2009 at 2:43 PM, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d years old., %s, %d); In other words, printf() has a variable

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Bruno Desthuilliers
Chris Rebert a écrit : On Wed, Mar 18, 2009 at 6:09 AM, Anthra Norell anthra.nor...@bluewin.ch wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute

Re: Roulette wheel

2009-03-19 Thread Gabriel Genellina
En Thu, 19 Mar 2009 08:06:35 -0200, mattia ger...@gmail.com escribió: OK, understood. Now, as a general rule, is it correct to say: - use generator expression when I just need to iterate over the list or call a function that involve an iterator (e.g. sum) and get the result, so the list is not

Re: Style formating of multiline query, advise

2009-03-19 Thread Marco Mariani
someone wrote: Also, for SQL, (A) why are you using nested joins?, and inner select produce smaller set which is then joined with other table, kind a optimization Did you time it? I've done some kind of a optimization that slowed queries by tenfold, because postgres didn't need my advice,

Re: Uploading a file using POST

2009-03-19 Thread Vijayendra Bapte
On Mar 19, 7:20 am, Justin Ezequiel justin.mailingli...@gmail.com wrote: On Mar 19, 8:50 am, Thomas Robitaille thomas.robitai...@gmail.com wrote: I am trying to upload a binary file (a tar.gz file to be exact) to a   web server using POST, from within a python script. What I would like

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread John Machin
On Mar 19, 11:43 pm, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d years old., %s, %d); In other words, printf() has a variable arguement

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Eric Brunel
Mr. Z wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d years old., %s, %d); In other words, printf() has a variable arguement list the we all know. I'm trying to do this in

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread John Machin
On Mar 19, 11:52 pm, Chris Rebert c...@rebertia.com wrote: On Thu, Mar 19, 2009 at 5:43 AM, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30; printf(My name is %s, name); printf(My name is %s and I am %d

Python benchmarks comparing 32-bit to 64-bit performance

2009-03-19 Thread python
Are there any benchmarks (pystones or other) that compare a 32-bit and 64-bit versions of Python? Ideally I'm looking for a benchmark comparing recent Python releases (2.6.x, 3.x) on an Intel platform. I'm specifically interested in areas of the Python language where a 64-bit implementation is

Preferred syntax for the docstrings

2009-03-19 Thread Luis Zarrabeitia
What's the preferred style to document code in python? I usually do something like this: === def somefunction(arg1, arg2, out = sys.stdout): This function does blahblablha with the string arg1, using the tuple of ints arg2 as the control sequence, and prints the result to out

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Chris Rebert
On Thu, Mar 19, 2009 at 6:13 AM, John Machin sjmac...@lexicon.net wrote: On Mar 19, 11:52 pm, Chris Rebert c...@rebertia.com wrote: On Thu, Mar 19, 2009 at 5:43 AM, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int

Re: Preferred syntax for the docstrings

2009-03-19 Thread Chris Rebert
On Thu, Mar 19, 2009 at 6:26 AM, Luis Zarrabeitia ky...@uh.cu wrote: What's the preferred style to document code in python? I usually do something like this: === def somefunction(arg1, arg2, out = sys.stdout):     This function does blahblablha with the string arg1, using    the tuple of

Re: How complex is complex?

2009-03-19 Thread Aahz
[posted and e-mailed] In article 033514d1-e0e9-4a1c-bca0-846781f0d...@w35g2000prg.googlegroups.com, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 11:29=A0am, Daniel Fetchinson fetchin...@googlemail.com wrote: Once every nuanced detail has been carefully weighed in and a consensus has

Re: Preferred syntax for the docstrings

2009-03-19 Thread Luis Zarrabeitia
Quoting Chris Rebert c...@rebertia.com: It's pretty subjective based on which documentation generator you use (or if you don't use one at all, just your personal style), but personally I'd recommend reStructuredText and Sphinx (http://sphinx.pocoo.org/) since they're used for the std lib's

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Anthra Norell
Bruno Desthuilliers wrote: Chris Rebert a écrit : On Wed, Mar 18, 2009 at 6:09 AM, Anthra Norell anthra.nor...@bluewin.ch wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base

Re: set_process_affinity_mask problem - Python 2.5 gcc 4.3.2 (Ubuntu 4.3.2-1ubuntu12)

2009-03-19 Thread Aahz
In article mailman.1499.1236566959.11746.python-l...@python.org, Isaac Gouy igo...@yahoo.com wrote: Now I've upgraded from Ubuntu 8.04 to Ubuntu 8.10 (from gcc 4.2.3 to gcc 4.3.2) and set_process_affinity_mask seems to fail on the x86 Ubuntu install. It still works fine, after upgrade, on the

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Mr. Z
Andrii V. Mishkovskyi misho...@gmail.com wrote in message news:mailman.2185.1237467269.11746.python-l...@python.org... On Thu, Mar 19, 2009 at 2:43 PM, Mr. Z no...@xspambellsouth.net wrote: I'm trying emulate a printf() c statement that does, for example char* name=Chris; int age=30;

Re: How to do this in Python? - A gotcha

2009-03-19 Thread bieffe62
On Mar 18, 6:06 pm, Jim Garrison j...@acm.org wrote: S Arrowsmith wrote: Jim Garrison  j...@acm.org wrote: It's a shame the iter(o,sentinel) builtin does the comparison itself, instead of being defined as iter(callable,callable) where the second argument implements the termination test

Re: Is python worth learning as a second language?

2009-03-19 Thread Aahz
In article 49b5196b$0$3514$426a7...@news.free.fr, Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: Grant Edwards a écrit : Knowing C++ does tend to be a bit of a handicap, but I think any competent programmer could learn Python. +2 QOTW !-) Ditto! Although I suppose you

Re: Is python worth learning as a second language?

2009-03-19 Thread Aahz
In article 49b58b35$0$3548$426a7...@news.free.fr, Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr wrote: Tomasz Rola a écrit : I may not be objective (tried Java, hated it after 6 years). Arf - only took me 6 months !-) That long? It only took me six minutes. -- Aahz

Re: supervisor 3.0a6 and Python2.6

2009-03-19 Thread Raymond Cote
George Trojan wrote: 1. Is supervisor still developed? I note that, although the information on the site is pretty old, there have been some respository checkins in Feb and March of this year: http://lists.supervisord.org/pipermail/supervisor-checkins/ -r --

can someone help me (again) stuck on ' hands on python'

2009-03-19 Thread Gary Wood
#I adjusted the 2nd main function so i test what im trying to do can someone point me in the right direction please Exercise 2.3.3.1. ** Rename the example file locationsStub.py to be locations.py, and complete the function printLocations, to print the index of each location in the string

Re: Is python worth learning as a second language?

2009-03-19 Thread grkuntzmd
The other day one of our developers said that he thought learning assembler language in college was a total waste of time. I can't disagree more. Even if assembler language is specific to one architecture, the principles that it teaches are universal and fundamental to all other programming

Re: How to do this in Python? - A gotcha

2009-03-19 Thread Scott David Daniels
bieff...@gmail.com wrote: On Mar 18, 6:06 pm, Jim Garrison j...@acm.org wrote: S Arrowsmith wrote: Jim Garrison j...@acm.org wrote: It's a shame the iter(o,sentinel) builtin does the comparison itself, instead of being defined as iter(callable,callable) where the second argument implements

Re: python equivalent of java technologies

2009-03-19 Thread Armin
On Thursday 19 March 2009 07:45:01 Jeremiah Dodds wrote: On Tue, Mar 17, 2009 at 8:32 PM, Armin feng.sh...@gmail.com wrote: You could tell her to try Jython. In that, you can just use the Java implementations. :) Plus, you have things in Jython that Java doesn't :D -- Armin Moradi

Re: supervisor 3.0a6 and Python2.6

2009-03-19 Thread George Trojan
Raymond Cote wrote: George Trojan wrote: 1. Is supervisor still developed? I note that, although the information on the site is pretty old, there have been some respository checkins in Feb and March of this year: http://lists.supervisord.org/pipermail/supervisor-checkins/ -r I found

DictReader and fieldnames

2009-03-19 Thread Ted To
Is it possible to grab the fieldnames that the csv DictReader module automatically reads from the first line of the input file? Thanks, Ted To -- http://mail.python.org/mailman/listinfo/python-list

Re: mxODBC (was split problem if the delimiter is inside the text limiter)

2009-03-19 Thread M.-A. Lemburg
On 2009-03-19 13:40, Tim Chase wrote: DB-API 2.0 has cursor.executemany() to make this differentiation at the API level. mxODBC will lift this requirement in the next version, promised :-) glad to hear...will executemany() take an arbitrary iterable? My (albeit somewhat-antiquated)

Wordpress management from Python: do you know main bindings/modules to automate Wordpress blogging from .py software?

2009-03-19 Thread Aldo Ceccarelli
Hi, Everybody! I'm a Wordpress newbie but will have need to automate posts and would like to use Python for this purpose too: can you lead the way to this target? Many thanks in advance for your kind indications! ps some times ago, I heard about a Wordpress Python Library too but I do not

Re: Preferred syntax for the docstrings

2009-03-19 Thread Scott David Daniels
Luis Zarrabeitia wrote: What's the preferred style to document code in python? ... def somefunction(arg1, arg2, out = sys.stdout): This function does blahblablha with the string arg1, using the tuple of ints arg2 as the control sequence, and prints the result to out (defaults to

Re: How complex is complex?

2009-03-19 Thread Paul McGuire
On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. Gaaah! Your question was just fine, a good question on coding style. I wish more people would ask such questions so

Can I rely on...

2009-03-19 Thread Emanuele D'Arrigo
Hi everybody, I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Take the following code: pattern = aPattern compiledPatterns = [ ] compiledPatterns.append(re.compile(pattern)) if(re.compile(pattern) in

Can I rely on...

2009-03-19 Thread Emanuele D'Arrigo
Sorry for the double-post, the first one was sent by mistake before completion. Hi everybody, I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Take the following code: pattern = aPattern compiledPatterns = [ ]

converting pipe delimited file to fixed width

2009-03-19 Thread digz
Hi, I am trying to convert a | delimited file to fixed width by right padding with spaces, Here is how I have written the program , just get the feeling this can be done in a much better ( python functional ) way rather than the procedural code i have below . Any help appreciated

Re: Can I rely on...

2009-03-19 Thread MRAB
Emanuele D'Arrigo wrote: Hi everybody, I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Take the following code: pattern = aPattern compiledPatterns = [ ] compiledPatterns.append(re.compile(pattern))

Re: Can I rely on...

2009-03-19 Thread MRAB
Emanuele D'Arrigo wrote: [snip] If the answer is no, am I right to state the in the case portrayed above the only way to be safe is to use the following code instead? for item in compiledPatterns: if(item.pattern == pattern): print(The compiled pattern is stored.) break

Re: Can I rely on...

2009-03-19 Thread Albert Hopkins
On Thu, 2009-03-19 at 08:42 -0700, Emanuele D'Arrigo wrote: Hi everybody, I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Take the following code: pattern = aPattern compiledPatterns = [ ]

Re: converting pipe delimited file to fixed width

2009-03-19 Thread MRAB
digz wrote: Hi, I am trying to convert a | delimited file to fixed width by right padding with spaces, Here is how I have written the program , just get the feeling this can be done in a much better ( python functional ) way rather than the procedural code i have below . Any help appreciated

Re: Do deep inheritance trees degrade efficiency?

2009-03-19 Thread Terry Reedy
Terry Reedy wrote: Anthra Norell wrote: Would anyone who knows the inner workings volunteer to clarify whether or not every additional derivation of a class hierarchy adds an indirection to the base class's method calls and attribute read-writes. More potential search layers rather than

Re: File Compare with difflib.context_diff

2009-03-19 Thread JohnV
Here is the latest version of the code: currentdata_file = rC:\Users\Owner\Desktop\newdata.txt # the latest download from the clock lastdata_file = rC:\Users\Owner\Desktop\mydata.txt # the prior download from the clock output_file = rC:\Users\Owner\Desktop\out.txt # will hold delta clock data

Simple question about yyyy/mm/dd

2009-03-19 Thread mattia
Hi all, I need to receive in input a date represented by a string in the form /mm/dd (or reversed), then I need to assure that the date is = the current date and then split the dates in variables like year, month, day. Is there some module to do this quickly? --

Re: How complex is complex?

2009-03-19 Thread Kottiyath
On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. Gaaah! Your question was just fine, a good question

Re: How complex is complex?

2009-03-19 Thread Kottiyath
On Mar 19, 9:33 pm, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the

Re: Can I rely on...

2009-03-19 Thread Terry Reedy
Emanuele D'Arrigo wrote: Hi everybody, I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Take the following code: pattern = aPattern compiledPatterns = [ ] compiledPatterns.append(re.compile(pattern))

Re: DictReader and fieldnames

2009-03-19 Thread skip
Ted Is it possible to grab the fieldnames that the csv DictReader Ted module automatically reads from the first line of the input file? Like this, perhaps? rdr = csv.DictReader(open(f.csv, rb)) rdr.fieldnames ['col1', 'col2', 'color'] rdr.next() {'color': '3',

Re: Simple question about yyyy/mm/dd

2009-03-19 Thread skip
Hi all, I need to receive in input a date represented by a string in the form /mm/dd (or reversed), then I need to assure that the date is = the current date and then split the dates in variables like year, month, day. Is there some module to do this quickly? The dateutil

Threads not Improving Performance in Program

2009-03-19 Thread Ryan Rosario
I have a parser that needs to process 7 million files. After running for 2 days, it had only processed 1.5 million. I want this script to parse several files at once by using multiple threads: one for each file currently being analyzed. My code iterates through all of the directories within a

Re: converting pipe delimited file to fixed width

2009-03-19 Thread Terry Reedy
digz wrote: Hi, I am trying to convert a | delimited file to fixed width by right padding with spaces, Here is how I have written the program , just get the feeling this can be done in a much better ( python functional ) way rather than the procedural code i have below . Any help appreciated

Re: converting pipe delimited file to fixed width

2009-03-19 Thread odeits
On Mar 19, 8:51 am, digz digvijo...@gmail.com wrote: Hi, I am trying to convert a | delimited  file to fixed width by right padding with spaces, Here is how I have written the program , just get the feeling this can be done in a much better ( python functional ) way rather than the procedural

cross compile Python to Linux-ARM

2009-03-19 Thread jefm
Hi, We are looking to use Python on an embedded Linux ARM system. What I gather from googling the subject is that it is not that straight forward (a fair amount of patching hacking). Nobody out there that has done it claims it is easy, which makes me worried. I haven't seen a description on

Missing values in tuple assignment

2009-03-19 Thread Jim Garrison
Use case: parsing a simple config file line where lines start with a keyword and have optional arguments. I want to extract the keyword and then pass the rest of the line to a function to process it. An obvious use of split(None,1) cmd,args= = line.split(None,1); if cmd in self.switch:

Re: Threads not Improving Performance in Program

2009-03-19 Thread odeits
On Mar 19, 9:50 am, Ryan Rosario uclamath...@gmail.com wrote: I have a parser that needs to process 7 million files. After running for 2 days, it had only processed 1.5 million. I want this script to parse several files at once by using multiple threads: one for each file currently being

Re: Simple question about yyyy/mm/dd

2009-03-19 Thread Scott David Daniels
mattia wrote: Hi all, I need to receive in input a date represented by a string in the form /mm/dd (or reversed), then I need to assure that the date is = the current date and then split the dates in variables like year, month, day. Is there some module to do this quickly? Look into

Re: What happened to NASA at Python? :(

2009-03-19 Thread Steve Holden
r wrote: On Mar 12, 3:31 am, Michele Simionato michele.simion...@gmail.com wrote: That's pretty much impossible. I am sure NASA uses all programming languages in existence, plus probably many internal ones we never heard of. True but... all([NASA.does_endorse(lang) for lang in

Re: Missing values in tuple assignment

2009-03-19 Thread Albert Hopkins
On Thu, 2009-03-19 at 11:57 -0500, Jim Garrison wrote: Use case: parsing a simple config file line where lines start with a keyword and have optional arguments. I want to extract the keyword and then pass the rest of the line to a function to process it. An obvious use of split(None,1)

Re: Strange crash issue on Windows w/ PyGTK, Cairo...

2009-03-19 Thread CJ Kucera
CJ Kucera wrote: Anyway, the issue turned out to be zlib.decompress() - for larger sets of data, if I wasn't specifying bufsize, the malloc()s that it was doing behind-the-scenes must have been clobbering memory. As soon as I specified bufsize, everything was totally kosher. Okay, I've got a

Re: Memory efficient tuple storage

2009-03-19 Thread psaff...@googlemail.com
In the end, I used a cStringIO object to store the chromosomes - because there are only 23, I can use one character for each chromosome and represent the whole lot with a giant string and a dictionary to say what each character means. Then I used numpy arrays for the data and coordinates. This

Re: What happened to NASA at Python? :(

2009-03-19 Thread Steve Holden
s...@pobox.com wrote: In fact, graphics were added for several organizations. I believe they will be chosen randomly. NASA is still there. MiO In that case, they must be using the random number generator from MiO Dilbert. You know, the one that said 9, 9, 9, 9,...

Re: Can I rely on...

2009-03-19 Thread Emanuele D'Arrigo
Thank you everybody for the informative replies. I'll have to comb my code for all the instances of item in sequence statement because I suspect some of them are as unsafe as my first example. Oh well. One more lesson learned. Thank you again. Manu --

Re: What happened to NASA at Python? :(

2009-03-19 Thread Dotan Cohen
There are about 40 people supporting the Mars Lander mission using Python and aiming for a launch window this September. Wish them luck! What, exactly, are they using Python for? -- Dotan Cohen http://what-is-what.com http://gibberish.co.il

Re: How complex is complex?

2009-03-19 Thread Paul Hildebrandt
On Mar 19, 9:41 am, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 9:33 pm, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish,

Re: What happened to NASA at Python? :(

2009-03-19 Thread Aahz
[posted and e-mailed] In article mailman.2216.1237483574.11746.python-l...@python.org, Dotan Cohen dotanco...@gmail.com wrote: PiBUaGVyZSBhcmUgYWJvdXQgNDAgcGVvcGxlIHN1cHBvcnRpbmcgdGhlIE1hcnMgTGFuZGVyIG1p c3Npb24gdXNpbmcKPiBQeXRob24gYW5kIGFpbWluZyBmb3IgYSBsYXVuY2ggd2luZG93IHRoaXMg

  1   2   3   >