Re: Split string but ignore quotes

2009-09-30 Thread Processor-Dev1l
On Sep 29, 5:11 pm, Scooter slbent...@gmail.com wrote: I'm attempting to reformat an apache log file that was written with a custom output format. I'm attempting to get it to w3c format using a python script. The problem I'm having is the field-to-field matching. In my python code I'm using

Re: Simple if-else question

2009-09-30 Thread Steven D'Aprano
On Tue, 29 Sep 2009 22:29:10 -0700, John Yeung wrote: On Sep 29, 1:15 pm, Carl Banks pavlovevide...@gmail.com wrote: Hmm, I wonder if Python should emit a warning if an else is used on a for block with no break inside.  I don't think the else can be invoked in any other way.  As a bonus it

Re: How to pass a global variable to a module?

2009-09-30 Thread Hendrik van Rooyen
On Tuesday, 29 September 2009 20:24:53 Mars creature wrote: From the link Gregor posted, it seems no way to share variable between modules. I can understand the point that global variables tends to mess up programs. Assume that I have 10 parameters need to pass to the function. If these

Re: Partial directory search question

2009-09-30 Thread lallous
chad cdal...@gmail.com wrote in message news:4e260ef3-8b0e-4613-a4f8-1c267e875...@u16g2000pru.googlegroups.com... On Sep 29, 7:20 pm, Tim Chase python.l...@tim.thechases.com wrote: What's the sanest way to print out all the files in the directory that start with the underscore? Ie, I just

Re: UnboundLocalError with extra code after return

2009-09-30 Thread Duncan Booth
Rich Healey healey.r...@gmail.com wrote: It seems that my problem was that I can't assign a new function to the name func within the callonce() function. I can however interact with the func object (in this case storing information about whether or not I'd called it in it's __RECALL item.

Re: Most active coroutine library project?

2009-09-30 Thread Hendrik van Rooyen
On Wednesday, 30 September 2009 04:16:45 Grant Edwards wrote: Assembler macros are indeed a lost art. Back in the day, I remember seeing some pretty impressive macro libraries layered 2-3 deep. I've done assember macros as recently as about 2-3 years go because it was the easiest way to

unicode issue

2009-09-30 Thread gentlestone
Why don't work this code on Python 2.6? Or how can I do this job? _MAP = { # LATIN u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'A', u'Å': 'A', u'Æ': 'AE', u'Ç':'C', u'È': 'E', u'É': 'E', u'Ê': 'E', u'Ë': 'E', u'Ì': 'I', u'Í': 'I', u'Î': 'I', u'Ï': 'I', u'Ð': 'D', u'Ñ': 'N',

Re: unicode issue

2009-09-30 Thread Andre Engels
On Wed, Sep 30, 2009 at 9:34 AM, gentlestone tibor.b...@hotmail.com wrote: Why don't work this code on Python 2.6? Or how can I do this job? Please be more specific than it doesn't work: * What exactly are you doing * What were you expecting the result of that to be * What is the actual result?

Re: Most active coroutine library project?

2009-09-30 Thread Paul Rubin
Hendrik van Rooyen hend...@microcorp.co.za writes: You were lucky - I started with an 8039 and the 8048 was a step up! This is getting a bit far away from python and coroutines, though. :-) Getting away from python in the opposite direction, if you click

Re: Simple if-else question

2009-09-30 Thread Terry Reedy
John Yeung wrote: On Sep 29, 1:15 pm, Carl Banks pavlovevide...@gmail.com wrote: Hmm, I wonder if Python should emit a warning if an else is used on a for block with no break inside. I don't think the else can be invoked in any other way. As a bonus it could catch some cases where people

Re: Can I make these getters/setters?

2009-09-30 Thread Bruno Desthuilliers
Michael George Lerner a écrit : Hi, As part of my GUI, I have lots of fields that people can fill in, defined like this: self.selection = Pmw.EntryField(group.interior(), labelpos='w',

Re: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 09:41 h., Andre Engels andreeng...@gmail.com wrote: On Wed, Sep 30, 2009 at 9:34 AM, gentlestone tibor.b...@hotmail.com wrote: Why don't work this code on Python 2.6? Or how can I do this job? Please be more specific than it doesn't work: * What exactly are you doing * What

a questions about thread-safety of boolean variables

2009-09-30 Thread Charlie Dickens
Hi,if I have a class A that contains a boolean variable named x, is it safe to read and change it from different threads without using locks? Is it guaranteed that A.x will be always True or False, and not any other weird value that that causes it to be inconsistent (assuming I only set it to True

Re: Business issues regarding adapting Python

2009-09-30 Thread Vladimir Ignatov
Python-related programming job. Positions both very rare (comparing with Java/C++ - maybe 1/100) and not pays well. And about 99% of them are web+Django. To who/what are you replying? Nope. Just a replic. BTW I agreed - just peek a good programmers and let them learn python. Literally in a

Re: unicode issue

2009-09-30 Thread Andre Engels
I get the feeling that the problem is with the Python interactive mode. It does not have full unicode support, so uŽabovitá zmiešaná kaša is changed to u'\x8eabovit\xe1 zmie\x9aan\xe1 ka\x9aa'. If you call your code from another program, it might work correctly. -- André Engels,

Re: a questions about thread-safety of boolean variables

2009-09-30 Thread steve
Hi, On 09/30/2009 01:53 PM, Charlie Dickens wrote: Hi, if I have a class A that contains a boolean variable named x, is it safe to read and change it from different threads without using locks? Is it guaranteed that A.x will be always True or False, and not any other weird value that that

Re: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 10:35 h., Andre Engels andreeng...@gmail.com wrote: I get the feeling that the problem is with the Python interactive mode. It does not have full unicode support, so uŽabovitá zmiešaná kaša is changed to u'\x8eabovit\xe1 zmie\x9aan\xe1 ka\x9aa'. If you call your code from another

Re: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 10:43 h., gentlestone tibor.b...@hotmail.com wrote: On 30. Sep., 10:35 h., Andre Engels andreeng...@gmail.com wrote: I get the feeling that the problem is with the Python interactive mode. It does not have full unicode support, so uŽabovitá zmiešaná kaša is changed to

Re: a questions about thread-safety of boolean variables

2009-09-30 Thread Charlie Dickens
What about dictionaries? Reading values, adding new ones and the most important: changing an existing value - can it corrupt the state of the dictionary or that it is guaranteed that if I try to read the value of this key, I can only get the old one or the new one, but not something weird instead

Re: How to pass a global variable to a module?

2009-09-30 Thread Jean-Michel Pichavant
Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-30 Thread Rüdiger Ranft
Stef Mientki schrieb: By making use of the one time login on windows, I'm not sure, but I guess the user environment variable USER should hold the vald user, which has probably a one-to-one relation with the SID Environment variables are *very* easy to forge. But since you use windows, you

Re: Simple if-else question

2009-09-30 Thread dksr
On Sep 29, 6:38 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: Carl Banks pavlovevide...@gmail.com wrote: Hmm, I wonder if Python should emit a warning if an else is used on a for block with no break inside.  I don't think the else can be invoked in any other way.  As a bonus it could

Re: unicode issue

2009-09-30 Thread Dave Angel
gentlestone wrote: Why don't work this code on Python 2.6? Or how can I do this job? _MAP = # LATIN u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'A', u'Å': 'A', u'Æ': 'AE', u'Ç':'C', u'È': 'E', u'É': 'E', u'Ê': 'E', u'Ë': 'E', u'Ì': 'I', u'Í': 'I', u'Î': 'I', u'Ï': 'I',

Re: Simple if-else question

2009-09-30 Thread Iain King
On Sep 30, 7:12 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Tue, 29 Sep 2009 22:29:10 -0700, John Yeung wrote: On Sep 29, 1:15 pm, Carl Banks pavlovevide...@gmail.com wrote: Hmm, I wonder if Python should emit a warning if an else is used on a for block with no break

Re: Simple if-else question

2009-09-30 Thread Duncan Booth
Iain King iaink...@gmail.com wrote: However, I assume you can get past the else by raising an exception, so the idea becomes a little muddled - do you warn when there is no break and no explicit raise caught outside the loop? What about an implicit exception? I would guess that code

Re: Partial directory search question

2009-09-30 Thread Tim Chase
import os for filename in os.listdir(/usr/bbs/confs/september): #stat = os.stat(filename) if filename.startswith(_): print filename yes, as lallous mentioned, this can be done as a list-comprehension/generator. If printing is all you want to do, it's a nice and concise

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread lallous
Thanks everyone. Finally, I used Falcolas suggestion and took into consideration sturlamolden's comments. Regards, Elias lallous lall...@lgwm.org wrote in message news:h9sgcn$iv...@aioe.org... Hello From my C extension module I want to store a C pointer in a given PyObject. The only way

Python book

2009-09-30 Thread lallous
Hello Can anyone suggest a good book Python book for advancing from beginner level? (I started with Learning Python 3rd ed) Regards, Elias -- http://mail.python.org/mailman/listinfo/python-list

Re: Python book

2009-09-30 Thread Parikshat Dubey
Learning Python and Python in a nutshell from O'Reilly Regards Parikshat Dubey On Wed, Sep 30, 2009 at 5:28 PM, lallous lall...@lgwm.org wrote: Hello Can anyone suggest a good book Python book for advancing from beginner level? (I started with Learning Python 3rd ed) Regards, Elias --

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread lallous
Hello After using the PyCObject, I cannot pickle the class anymore. Any simple solution to this problem? (or resorting to __reduce__ is the only solution?) Thanks, Elias Falcolas garri...@gmail.com wrote in message news:9d3790aa-f7d9-4bb5-a81f-5428b2d60...@v25g2000yqk.googlegroups.com...

Re: Python book

2009-09-30 Thread Krishnakant
On Wed, 2009-09-30 at 17:38 +0530, Parikshat Dubey wrote: Learning Python and Python in a nutshell from O'Reilly Regards Parikshat Dubey How to think like a computer scientist in python is a good book to go from beginner to intermediate level. another good book is dive into python. Mail

Python 2.6.3rc1 available

2009-09-30 Thread Barry Warsaw
The first (and hopefully last) release candidate for Python 2.6.3 is now available via http://www.python.org/download/releases/2.6.3/ Source releases and Windows binaries are currently available, and Mac OS X binaries should be forthcoming. Nearly 100 bugs have been fixed since 2.6.2.

SQLObject 0.10.8

2009-09-30 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.10.8, a minor bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

SQLObject 0.11.2

2009-09-30 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.11.2, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Re: is this whiff/wsgi claim true?

2009-09-30 Thread Aaron Watters
regarding http://aaron.oirt.rutgers.edu/myapp/docs/W1000.concepts On Sep 27, 11:12 pm, Дамјан Георгиевски gdam...@gmail.com wrote: mod_wsgi (the apache module) can be configured to automatically run any .wsgi file dropped in a folder just like CGI ... see here

Re: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 11:45 h., Dave Angel da...@dejaviewphoto.com wrote: gentlestone wrote: Why don't work this code on Python 2.6? Or how can I do this job? _MAP =     # LATIN     u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'A', u'Å': 'A', u'Æ': 'AE', u'Ç':'C',     u'È': 'E', u'É':

Python logging and 1.5.2 compatibility

2009-09-30 Thread Vinay Sajip
I'm planning to officially drop support for Python 1.5.2 in the logging package. When the logging package was introduced in Python 2.3, many Linux distros were shipping 1.5.2 as the system's Python, even though 2.2 had been out for a while. So it seemed important to support 1.5.2 for those

Re: print object attributes recursively

2009-09-30 Thread Piet van Oostrum
lallous lall...@lgwm.org (l) wrote: l Hello l Suppose I have this code: l class X: ldef __init__(self, n): lself.L = [x for x in xrange(0, n+1)] l class Y: ldef __init__(self, n): lself.M = [X(x) for x in xrange(0, n)] l t = Y(5) l How can I easily print t and all

Re: logging.handlers.SMTPHandler question

2009-09-30 Thread Chris Withers
akonsu wrote: hello, SMTPHAndler seems to email every single record separately. is there a way to collect all log output and then send it in a single email message? or do i have to do it manually? You want the SummarisingHandler from this package:

Re: Repeated output when logging exceptions

2009-09-30 Thread Chris Withers
Vinay Sajip wrote: I'm not sure why you need all the code you've posted. The logging package allows you to add tracebacks to your logs by using the exception() method, which logs an ERROR with a traceback and is specifically intended for use from within exception handlers. You can also use

Re: Repeated output when logging exceptions

2009-09-30 Thread Chris Withers
John Gordon wrote: If I didn't do all that in a class, where would I do it? I find the configureLoggers method of ZConfig most convenient for this: http://pypi.python.org/pypi/ZConfig cheers, Chris -- Simplistix - Content Management, Batch Processing Python Consulting -

Re: problems trying to build python 2.6 as a shared library

2009-09-30 Thread Chris Withers
Marco Nawijn wrote: 2. Add path to dynamic linker configuration file. This typically is in '/etc/ld.so.conf'. See man page for ld for more information. Yes, this was it. Don't forget to run ldconfig after you've changed /etc/ld.so.conf It's frustrating how the contents of this file vary

Re: Can I make these getters/setters?

2009-09-30 Thread Michael rotini Lerner
Excellent. I now understand why it was broken, and a slightly tweaked version of FieldProperty does what I want. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot get POST to work

2009-09-30 Thread Piet van Oostrum
tedpot...@gmail.com tedpot...@gmail.com (t) wrote: t Hi, t I'm trying to post data to a short test script in php I wrote. t The python code to do the post is t import httplib t #server address t conn = httplib.HTTPConnection(localhost) headers = {Content-type:

Re: unicode issue

2009-09-30 Thread saeed.gnu
I recommend to use UTF-8 coding(specially in GNU/Linux) then write this in the second line: #-*- coding: latin-1 -*- -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode issue

2009-09-30 Thread Mark Tolonen
Dave Angel da...@dejaviewphoto.com wrote in message news:4ac328d4.3060...@dejaviewphoto.com... gentlestone wrote: Why don't work this code on Python 2.6? Or how can I do this job? _MAP = # LATIN u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'A', u'Å': 'A', u'Æ': 'AE', u'Ç':'C',

python memory use

2009-09-30 Thread Gary Robinson
The chart at http://shootout.alioth.debian.org/u32q/benchmark.php?test=alllang=javasteadylang2=pythonbox=1 is very interesting to me because it shows CPython using much less memory than Java for most tests. I'd be interested in knowing whether anybody can share info about how representative

Re: unicode issue

2009-09-30 Thread Piet van Oostrum
Dave Angel da...@dejaviewphoto.com (DA) wrote: DA Works for me: DA rrr = downcode(uŽabovitá zmiešaná kaša) DA print repr(rrr) DA print rrr DA prints out: DA u'Zabovita zmiesana kasa' DA Zabovita zmiesana kasa DA I did have to add an encoding declaration as line 2 of the file: DA #-*-

Re: Simple if-else question

2009-09-30 Thread Carl Banks
On Sep 30, 3:40 am, Iain King iaink...@gmail.com wrote: Read the suggestion again - it's not a warning on the for-else structure, it's a warning when the for-else doesn't contain a break; he's theorising that a for-else without a break will always trigger the else, in which case it's almost

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread Carl Banks
On Sep 30, 5:24 am, lallous lall...@lgwm.org wrote: Hello After using the PyCObject, I cannot pickle the class anymore. Any simple solution to this problem? (or resorting to __reduce__ is the only solution?) You can't pickle a CObject, you'd have to create a custom type (one that implements

Re: Partial directory search question

2009-09-30 Thread Rami Chowdhury
Rami Chowdhury Never attributed to malice that which can be attributed to stupidity. -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) On Tuesday 29 September 2009 19:54:17 chad wrote: On Sep 29, 7:52 pm, chad cdal...@gmail.com wrote: On Sep 29, 7:20 pm, Tim

Re: Python book

2009-09-30 Thread Patrick Sabin
My favorite book is Python Essential Reference from David M. Beazley. It is not a beginner book. It is about the python language and not about a framework or third-party library. It is much more complete than for instance Dive into python, but maybe somewhat more difficult. - Patrick

Re: Most active coroutine library project?

2009-09-30 Thread Hendrik van Rooyen
On Wednesday, 30 September 2009 09:46:38 Paul Rubin wrote: Getting away from python in the opposite direction, if you click http://cufp.galois.com/2008/schedule.html the second presentation Controlling Hybrid Vehicles with Haskell might interest you. Basically it's about a high level

SVG PIL decoder

2009-09-30 Thread Patrick Sabin
I would like to open svg files with PIL, but svg doesn't seem to be supported. Does anyone know about a svg decoder for the PIL? - Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: [Image-SIG] Some issue with easy_install and PIL/Imaging

2009-09-30 Thread Chris Withers
Fredrik Lundh wrote: On Fri, Sep 11, 2009 at 3:49 PM, Chris Withers ch...@simplistix.co.uk wrote: Klein Stéphane wrote: Resume : 1. first question : why PIL package in pypi don't work ? Because Fred Lundh have his package distributions unfortunate names that setuptools doesn't like... It

Re: SVG PIL decoder

2009-09-30 Thread Donn
On Wednesday 30 September 2009 18:01:50 Patrick Sabin wrote: I would like to open svg files with PIL, but svg doesn't seem to be supported. Does anyone know about a svg decoder for the PIL? Have a look at Cairo (python-cairo) in conjunction with librsvg (python-rsvg) -- that'll fix you up. You

Re: unicode issue

2009-09-30 Thread Dave Angel
Piet van Oostrum wrote: Dave Angel da...@dejaviewphoto.com (DA) wrote: DA Works for me: DA rrr = downcode(uŽabovitá zmiešaná kaša) DA print repr(rrr) DA print rrr DA prints out: DA u'Zabovita zmiesana kasa' DA Zabovita zmiesana kasa

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread Carl Banks
On Sep 29, 11:16 am, sturlamolden sturlamol...@yahoo.no wrote: On 29 Sep, 19:11, Carl Banks pavlovevide...@gmail.com wrote: CObjects can be passed a C function as a deallocator; this should work as reliably as a custom class deallocator. Except that __del__ prevents cyclic GC. You are

Re: Python logging and 1.5.2 compatibility

2009-09-30 Thread TerryP
On Sep 30, 1:26 pm, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: A 1.5.2-compatible version of the package is still available viahttp://www.red-dove.com/python_logging.htmlif anyone needs it. This version is not actively maintained, but that shouldn't be an issue. Regards, Vinay Sajip As

Re: python memory use

2009-09-30 Thread Mensanator
On Sep 30, 9:38 am, Gary Robinson gary...@me.com wrote: The chart athttp://shootout.alioth.debian.org/u32q/benchmark.php?test=alllang=ja...is very interesting to me because it shows CPython using much less memory than Java for most tests. Which version of Python? If you're talking 3.x for

Re: print object attributes recursively

2009-09-30 Thread TerryP
On Sep 30, 1:49 pm, Piet van Oostrum p...@cs.uu.nl wrote: I don't know what print_r does, but in your example above print [x.L for x in t.M] would work. Probably you would split this into two methods in X and Y. -- Piet van Oostrum p...@vanoostrum.org WWW:http://pietvanoostrum.com/ PGP

Re: python memory use

2009-09-30 Thread Isaac Gouy
On Sep 30, 7:38 am, Gary Robinson gary...@me.com wrote: The chart athttp://shootout.alioth.debian.org/u32q/benchmark.php?test=all〈=ja...is very interesting to me because it shows CPython using much less memory than Java for most tests. I'd be interested in knowing whether anybody can

M2Crypto 0.20.1 won't build on Red Hat Linux

2009-09-30 Thread John Nagle
M2Crypto, from http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.20.1.tar.gz won't build on Red Hat Linux / 386. The error is swig -python -I/usr/local/include/python2.5 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i /usr/include/openssl/opensslconf.h:27:

Re: python memory use

2009-09-30 Thread TerryP
Honestly, the only performance data involving Java, that would ever surprise me: is when a Java program takes less time to startup and get going, then the computer it is being run from did ;). When planning-ahead for a project, I look at what performance the language implementations offer, in

Re: Python book

2009-09-30 Thread James Matthews
I like core python programming and dive into python. On Wed, Sep 30, 2009 at 11:57 AM, Patrick Sabin patrick.just4...@gmail.comwrote: My favorite book is Python Essential Reference from David M. Beazley. It is not a beginner book. It is about the python language and not about a framework or

Re: is there some error crashing reporting

2009-09-30 Thread Stef Mientki
Stef Mientki wrote: like MadExcept for Delphi http://www.madshi.net/madExceptDescription.htm which catches any error, send an email with the error report and complete system analysis to the author, and continues the program (if possible) thanks, Stef apparently there isn't any such tool ;-(

Re: Python book

2009-09-30 Thread geremy condra
On Wed, Sep 30, 2009 at 7:58 AM, lallous lall...@lgwm.org wrote: Hello Can anyone suggest a good book Python book for advancing from beginner level? (I started with Learning Python 3rd ed) Regards, Elias dive into python and, for me, foundations of python network programming- narrowly

Problem building Python from source

2009-09-30 Thread Kent Tenney
Trying to do a vanilla cmmi: ~/Python-2.6.3rc1$ ./configure ~/Python-2.6.3rc1$ make ... Traceback (most recent call last): ... ImportError: No module named cStringIO make: *** [sharedmods] Error 1 The fix is to uncomment the line in Modules/Setup #cStringIO cStringIO.c Question: Is there an

Re: UnboundLocalError with extra code after return

2009-09-30 Thread John Posner
Duncan Booth wrote: / class CallableOnlyOnce(object): /def __init__(self, func): self.func = func def __call__(self): f = self.func if f: self.func = None return f() / def callonce(func): / return CallableOnlyOnce(func) / @callonce

Quick compare string to list

2009-09-30 Thread Scooter
I'm reading in a text file, and for each line in the file, I'm looking for the existence of phrases from a list. The list contains approx. 120 items currently but will most likely grow. This procedure itself is not the main function of my program and only grew out of the need to reformat certain

Re: Quick compare string to list

2009-09-30 Thread Terry Reedy
Scooter wrote: I'm reading in a text file, and for each line in the file, I'm looking for the existence of phrases from a list. The list contains approx. 120 items currently but will most likely grow. This procedure itself is not the main function of my program and only grew out of the need to

Re: Quick compare string to list

2009-09-30 Thread Emile van Sebille
On 9/30/2009 11:36 AM Scooter said... I'm reading in a text file, and for each line in the file, I'm looking for the existence of phrases from a list. The list contains approx. 120 items currently but will most likely grow. This procedure itself is not the main function of my program and only

Re: python memory use

2009-09-30 Thread Paul Rubin
Gary Robinson gary...@me.com writes: I'd be interested in knowing whether anybody can share info about how representative those test results are. For instance, suppose we're talking about a huge dictionary that maps integers to lists of integers (something I use in my code). Would something

Re: Python book

2009-09-30 Thread wesley chun
On Sep 30, 4:58 am, lallous lall...@lgwm.org wrote: Can anyone suggest a good book Python book for advancing from beginner level? (I started with Learning Python 3rd ed) From: James Matthews nyt...ail.com Date: Wed Sep 30 18:47:58 CEST 2009 I like core python programming and dive into

Re: How to pass a global variable to a module?

2009-09-30 Thread Mars creature
On Sep 30, 5:31 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users,   I just start to use python

How different are a generator's send and next methods

2009-09-30 Thread Andrey Fedorov
As far as I can tell, a generator's .next() is equivalent to .send(None). Is this true? If so, aren't they unified in a method with a single argument which defaults to None? - Andrey -- http://mail.python.org/mailman/listinfo/python-list

Re: python memory use

2009-09-30 Thread Bearophile
Gary Robinson: (I could test the particular case I mention, but I'm wondering if someone has some fundamental knowledge that would lead to a basic understanding.) Java is one of the languages most avid of memory, often even more than Python 2.x. Some bad people have said that Java developers

Re: Quick compare string to list

2009-09-30 Thread Bearophile
Scooter: I'm reading in a text file, and for each line in the file, I'm looking for the existence of phrases from a list. The list contains approx. 120 items currently but will most likely grow. This procedure itself is not the main function of my program and only grew out of the need to

RotatingFileHandler issue

2009-09-30 Thread Max Lynch
Hi. I have a RotatingFileHandler for my logging system. I have it set to rotate once the file becomes 5MB in size. Here is the conf line I have in my logging config file: [handler_fileHandlerDebugNoRequest] class=handlers.RotatingFileHandler formatter=formatterNoRequest

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread sturlamolden
On 30 Sep, 19:03, Carl Banks pavlovevide...@gmail.com wrote: Second, CObjects do not have a __del__ method.  They call the supplied constructor from the type's tp_dealloc slot.  Use of the tp_dealloc slot does not, by itself, prevent cyclic GC. Bottom line is, the CObject's deallocator is as

Re: unicode issue

2009-09-30 Thread Piet van Oostrum
Dave Angel da...@ieee.org (DA) wrote: [snip] DA Thanks for the correction. What I meant by works for me is that the DA single example in the docstring translated okay. But I do have a lot to DA learn about using Unicode in sources, and I want to learn. DA So tell me, how were we supposed to

Re: Quick compare string to list

2009-09-30 Thread Steven D'Aprano
On Wed, 30 Sep 2009 11:36:03 -0700, Scooter wrote: I'm reading in a text file, and for each line in the file, I'm looking for the existence of phrases from a list. The list contains approx. 120 items currently but will most likely grow. This procedure itself is not the main function of my

Re: Most active coroutine library project?

2009-09-30 Thread Rhodri James
On Mon, 28 Sep 2009 15:44:48 +0100, Grant Edwards inva...@invalid.invalid wrote: $10 is pretty expensive for a lot of applications. I bet that processor also uses a lot of power and takes up a lot of board space. If you've only got $2-$3 in the money budget, 200uA at 1.8V in the power

Re: iterate over list while changing it

2009-09-30 Thread Aahz
In article mailman.430.1253826262.2807.python-l...@python.org, Terry Reedy tjre...@udel.edu wrote: Torsten Mohr wrote: a = [1, 2, 3, 4, 5, 6] for i, x in enumerate(a): If you change a list while iterating over, start at the tail. This only applies if you add/remove elements; simply

Re: SVG PIL decoder

2009-09-30 Thread Patrick Sabin
Donn wrote: Have a look at Cairo (python-cairo) in conjunction with librsvg (python-rsvg) -- that'll fix you up. You can go from an SVG to a PNG/array and thence into PIL if you need to. Thanks for the tip. Got it work, although it was a bit tricky, as resizing doesn't seem to be supported

Re: Most active coroutine library project?

2009-09-30 Thread Grant Edwards
On 2009-09-30, Rhodri James rho...@wildebst.demon.co.uk wrote: On Mon, 28 Sep 2009 15:44:48 +0100, Grant Edwards inva...@invalid.invalid wrote: $10 is pretty expensive for a lot of applications. I bet that processor also uses a lot of power and takes up a lot of board space. If you've only

Re: Python logging and 1.5.2 compatibility

2009-09-30 Thread Aahz
In article mailman.693.1254317221.2807.python-l...@python.org, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: I'm planning to officially drop support for Python 1.5.2 in the logging package. Sounds good -- posting publicly about it is definitely appreciated. -- Aahz (a...@pythoncraft.com)

sympy returns a dictionary sometimes, and sometimes a list of tuples...why?

2009-09-30 Thread Brian Blais
Hello, I wrote a very simple script using sympy, and things were working fine, except for one problem. So I have: from sympy import * x, y = symbols('x','y',real=True) alpha,beta,gamma=symbols('alpha','beta','gamma',real=True)

ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-09-30 Thread Robert Hicks
I am just curious which I should use. I am going to start learning Python soon. Are they comparable and I just do a eenie meenie minie moe? Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: SVG PIL decoder

2009-09-30 Thread Donn
On Thursday 01 October 2009 01:08:28 Patrick Sabin wrote: Thanks for the tip. Got it work, although it was a bit tricky, as resizing doesn't seem to be supported by python-rsvg and cairo.ImageSurface.create_from_png doesn't allow StringIO or My best suggestions are to visit the Cairo website --

Re: How to pass a global variable to a module?

2009-09-30 Thread Mel
Mars creature wrote: On Sep 30, 5:31 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Mars creature wrote: On Sep 29, 12:49 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature jin...@gmail.com wrote: Dear Python users, I

Python and ASP - failure on 2nd and subsequent page loads

2009-09-30 Thread Jon Southard
I would be grateful for any advice about a problem which is preventing me from using Python for my current project. I am hoping to use Python 2.6.2 on the server side with Microsoft ASP [not ASP.NET; version details below]. The behavior I see is: 1. Load very simple page [text below]

Re: iterate over list while changing it

2009-09-30 Thread Дамјан Георгиевски
a = [1, 2, 3, 4, 5, 6] for i, x in enumerate(a): If you change a list while iterating over, start at the tail. ...reversed(enumerate(a)) Python 2.6.2 (r262:71600, Jul 20 2009, 02:19:59) a = [1, 2, 3, 4, 5, 6] reversed(enumerate(a)) Traceback (most recent call last): File stdin,

Re: Partial directory search question

2009-09-30 Thread alex23
Tim Chase python.l...@tim.thechases.com wrote: If you're doing more processing than just printing it, your for-loop is a better (clearer) way to go.  If you have lots of processing code, it might help to do the inverse:    for filename in os.listdir(location):      if not

Re: Simple if-else question

2009-09-30 Thread alex23
dksr dksre...@gmail.com wrote: Yes thats what I thought. for-else looks similar to if-else and in if- else, else part is executed only when if part is not executed, but in for-else it has entirely a different job. If you think of if-else more in terms of the else-branch occurring when the

Re: sympy returns a dictionary sometimes, and sometimes a list of tuples...why?

2009-09-30 Thread Robert Kern
Brian Blais wrote: Hello, I wrote a very simple script using sympy, and things were working fine, except for one problem. So I have: You will probably want to ask on the sympy mailing list: http://groups.google.com/group/sympy from sympy import * x, y = symbols('x','y',real=True)

Re: ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-09-30 Thread Jon Clements
On 1 Oct, 00:51, Robert Hicks sigz...@gmail.com wrote: I am just curious which I should use. I am going to start learning Python soon. Are they comparable and I just do a eenie meenie minie moe? Bob First off, a great choice of language to begin trying! Is it your first language (I'm

Re: ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-09-30 Thread Robert H
On Sep 30, 9:07 pm, Jon Clements jon...@googlemail.com wrote: On 1 Oct, 00:51, Robert Hicks sigz...@gmail.com wrote: I am just curious which I should use. I am going to start learning Python soon. Are they comparable and I just do a eenie meenie minie moe? Bob First off, a great

Re: ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-09-30 Thread srid
On Sep 30, 4:51 pm, Robert Hicks sigz...@gmail.com wrote: I am just curious which I should use. I am going to start learning Python soon. Are they comparable and I just do a eenie meenie minie moe? ActivePython is essentially same as the installers from python.org - but it also comes with

Re: ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-09-30 Thread Robert H
On Sep 30, 9:28 pm, srid sridhar.ra...@gmail.com wrote: On Sep 30, 4:51 pm, Robert Hicks sigz...@gmail.com wrote: I am just curious which I should use. I am going to start learning Python soon. Are they comparable and I just do a eenie meenie minie moe? ActivePython is essentially same

  1   2   >