Re: unicode issue

2009-09-30 Thread gentlestone
>save in utf-8 the coding declaration also has to be utf-8 ok, I understand, but what's the problem? Unfortunately seems to be the Python interactive mode doesn't have unicode support. It recognize the latin-1 encoding only. So I have 2 options, how to write doctest: 1. Replace native charaters w

Python and lost files

2009-09-30 Thread Timothy W. Grove
Recently I purchased some software to recover some files which I had lost. (A python project, incidentally! Yes, I should have kept better backups!) They were nowhere to found in the file system, nor in the recycle bin, but this software was able to locate them and restore them. I was just wond

Python RPG Codebase

2009-09-30 Thread Lanny
I've been thinking about putting together a text based RPG written fully in Python, possibly expanding to a MUD system. I'd like to know if anyone feels any kind of need for this thing or if I'd be wasting my time, and also if anyone would be interested in participating, because of the highly modul

Re: Python book

2009-09-30 Thread Ralf Schoenian
lallous wrote: Hello Can anyone suggest a good book Python book for advancing from beginner level? (I started with Learning Python 3rd ed) Regards, Elias Hi Elias, welcome to Python. I have learned Python with the official tutorial and with the outstanding book: Beginning Python, From No

Re: iterate over list while changing it

2009-09-30 Thread Daniel Stutzbach
On Thu, Sep 24, 2009 at 3:32 PM, Torsten Mohr wrote: > a = [1, 2, 3, 4, 5, 6] > > for i, x in enumerate(a): >if x == 3: >a.pop(i) >continue > >if x == 4: >a.push(88) > >print "i", i, "x", x > > I'd like to iterate over a list and change that list while iteratin

Re: Most "active" coroutine library project?

2009-09-30 Thread Dave Angel
Grant Edwards wrote: On 2009-09-30, Rhodri James wrote: On Mon, 28 Sep 2009 15:44:48 +0100, Grant Edwards 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 mone

Re: unicode issue

2009-09-30 Thread Dave Angel
Piet van Oostrum wrote: Dave Angel (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.

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 wrote: > On Sep 30, 4:51 pm, Robert Hicks 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.

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 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 additional docume

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 wrote: > On 1 Oct, 00:51, Robert Hicks 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 t

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 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 guessing not), or

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) alpha

Re: Simple if-else question

2009-09-30 Thread alex23
dksr 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 if-condition is no l

Re: Partial directory search question

2009-09-30 Thread alex23
Tim Chase 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 filename.startswith('_'): continue >      l

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):

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] i

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 > wrote: >> Mars creature wrote: >> > On Sep 29, 12:49 pm, "Rami Chowdhury" >> > wrote: >> >> >> On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature >> >> wrote: >> >> >>> Dear Python users, >> >>> I just start to use python and lov

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

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

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) alpha_p,beta_p,gamma_p=symbols('alpha_p','beta_p','gamma_p',real

Re: Python logging and 1.5.2 compatibility

2009-09-30 Thread Aahz
In article , Vinay Sajip 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) <*> http://www.pythoncraft.com/ "Normal is what cuts o

Re: Most "active" coroutine library project?

2009-09-30 Thread Grant Edwards
On 2009-09-30, Rhodri James wrote: > On Mon, 28 Sep 2009 15:44:48 +0100, Grant Edwards > 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 >

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 by

Re: iterate over list while changing it

2009-09-30 Thread Aahz
In article , Terry Reedy 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 updating elements does not require starting at the tail. -- A

Re: Most "active" coroutine library project?

2009-09-30 Thread Rhodri James
On Mon, 28 Sep 2009 15:44:48 +0100, Grant Edwards 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 budget, and 6mm X 6mm of board

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: unicode issue

2009-09-30 Thread Piet van Oostrum
> Dave Angel (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 gues

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread sturlamolden
On 30 Sep, 19:03, Carl Banks 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 reliable as a custo

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 args=('/web/logs/gobuzz_d

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

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

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: How to pass a global variable to a module?

2009-09-30 Thread Mars creature
On Sep 30, 5:31 am, Jean-Michel Pichavant wrote: > Mars creature wrote: > > On Sep 29, 12:49 pm, "Rami Chowdhury" > > wrote: > > >> On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature wrote: > > >>> Dear Python users, > >>>   I just start to use python and love this language. I met this > >>> prob

Re: Python book

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

Re: python memory use

2009-09-30 Thread Paul Rubin
Gary Robinson 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 like that > r

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 gre

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 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 ph

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 /

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 arg

Re: Python book

2009-09-30 Thread geremy condra
On Wed, Sep 30, 2009 at 7:58 AM, lallous 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 targeted

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 James Matthews
I like core python programming and dive into python. On Wed, Sep 30, 2009 at 11:57 AM, Patrick Sabin wrote: > 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. I

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 the

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: Er

Re: python memory use

2009-09-30 Thread Isaac Gouy
On Sep 30, 7:38 am, Gary Robinson 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 share info ab

Re: print object attributes recursively

2009-09-30 Thread TerryP
On Sep 30, 1:49 pm, Piet van Oostrum 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 > WWW:http://pietvanoostrum.com/ > PGP key: [8DAE142BE17999C4] P

Re: python memory use

2009-09-30 Thread Mensanator
On Sep 30, 9:38 am, Gary Robinson wrote: > The chart > athttp://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=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 Windows, a

Re: Python logging and 1.5.2 compatibility

2009-09-30 Thread TerryP
On Sep 30, 1:26 pm, Vinay Sajip 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 long as people ca

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread Carl Banks
On Sep 29, 11:16 am, sturlamolden wrote: > On 29 Sep, 19:11, Carl Banks 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 mistaken on two counts. First of all, a

Re: unicode issue

2009-09-30 Thread Dave Angel
Piet van Oostrum wrote: Dave Angel (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

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: [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 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 used to support this, b

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: 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 l

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 lal

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 wrote: > > On Sep 29, 7:20 pm, Tim Chase wrote:

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread Carl Banks
On Sep 30, 5:24 am, "lallous" 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 one of th

Re: Simple if-else question

2009-09-30 Thread Carl Banks
On Sep 30, 3:40 am, Iain King 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 certainly an erro

Re: unicode issue

2009-09-30 Thread Piet van Oostrum
> Dave Angel (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> #-*- codin

python memory use

2009-09-30 Thread Gary Robinson
The chart at http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=javasteady&lang2=python&box=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 Mark Tolonen
"Dave Angel" 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', u'È': 'E', u'É': 'E

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: Cannot get POST to work

2009-09-30 Thread Piet van Oostrum
> "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": "application/x-www-form-urlenc

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: 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 fr

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 - http://

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 the

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: http://www.simplistix.co.uk/software/python/m

Re: print object attributes recursively

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

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 sysad

Re: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 11:45 h., Dave Angel 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'É': 'E', u'Ê': '

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, Дамјан Георгиевски wrote: > mod_wsgi (the apache module) can be configured to automatically run any > .wsgi file dropped in a folder just like CGI ... see here > http://code.google.com/p/modwsgi/wiki/Configur

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 eas

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 eas

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. Bar

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

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" wrote in message news:9d3790aa-f7d9-4bb5-a81f-5428b2d60...@v25g2000yqk.googlegroups.com... On Sep 29, 2:27 am

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 wrote: > Hello > > Can anyone suggest a good book Python book for advancing from beginner > level? > > (I started with Learning Python 3rd ed) > > Regards, > Elias > -- >

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: 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" 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 I figure how to

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: Simple if-else question

2009-09-30 Thread Duncan Booth
Iain King 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 intentionally using an

Re: Simple if-else question

2009-09-30 Thread Iain King
On Sep 30, 7:12 am, Steven D'Aprano wrote: > On Tue, 29 Sep 2009 22:29:10 -0700, John Yeung wrote: > > On Sep 29, 1:15 pm, Carl Banks 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 > >>

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', u'Ð'

Re: Simple if-else question

2009-09-30 Thread dksr
On Sep 29, 6:38 pm, Duncan Booth wrote: > Carl Banks 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 > > mistakenly

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,

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" wrote: On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature 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 in a separate file. The question is how

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: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 10:43 h., gentlestone wrote: > On 30. Sep., 10:35 h., Andre Engels 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'.

Re: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 10:35 h., Andre Engels 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 program, it migh

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 causes

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, andreeng...@gm

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

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: unicode issue

2009-09-30 Thread gentlestone
On 30. Sep., 09:41 h., Andre Engels wrote: > On Wed, Sep 30, 2009 at 9:34 AM, gentlestone 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

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', label_text='Selection

Re: Simple if-else question

2009-09-30 Thread Terry Reedy
John Yeung wrote: On Sep 29, 1:15 pm, Carl Banks 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 mistakenly use it thinking it

Re: Most "active" coroutine library project?

2009-09-30 Thread Paul Rubin
Hendrik van Rooyen 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 http://cufp.galois.com/2008/schedule.html the seco

Re: unicode issue

2009-09-30 Thread Andre Engels
On Wed, Sep 30, 2009 at 9:34 AM, gentlestone 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? -- André Engels, a

  1   2   >