Sphinx 0.6.1 and 0.5.2 released

2009-03-27 Thread Georg Brandl
Hi all, I'm proud to announce the release of Sphinx 0.6.1 and 0.5.2. Sphinx 0.5.2 is a bugfix-only release in the 0.5 series, while 0.6.1 is a feature release, containing all of 0.5.2's fixes together with many added features. These are beta releases, so please test them out and report any bugs

Announcing IronPython 2.6 Alpha 1

2009-03-27 Thread Dave Fugate
Hello Python Community, We're pleased to announce the release of IronPython 2.6 Alpha 1. As you might imagine, this release is all about supporting new CPython 2.6 features such as the 'bytes' and 'bytearray' types (PEP 3112), decorators for classes (PEP 3129), advanced string formatting (PEP

[ANN] pyxser-0.1r (release 0.1)

2009-03-27 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 - From the readme file: - -8--8--8--8- pxyser --- python xml serialization pyxser stands for Python XML Serialization, it's Python object serializer that does the job in a standard way. Unlike other serializers, it

ANN: Portable Python 1.1 released

2009-03-27 Thread Perica Zivkovic
Included in this release: - This release contains three different packages for three different Python versions – Python 2.5.4, Python 2.6.1 and Python 3.0.1. Packages are totally independent and can run side-by-side each other or any other Python installation. Software

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Paul Rubin
Dennis Lee Bieber wlfr...@ix.netcom.com writes: ... v = theDict.get(x, NOT_RELEVANT) ... if v is not NOT_RELEVANT: ... print x, v I think you'd normally do this with if x in theDict: print x, v but the OP was asking about a different problem, involving looking up

C extension using GSL

2009-03-27 Thread jesse
I give up. I cannot find my memory leak! I'm hoping that someone out there has come across something similar. Let me lay out the basic setup: I'm performing multiple simulations on a model. Each iteration involves solving a system of differential equations. For this I use the GNU Scientific

Re: running shelscript inside python

2009-03-27 Thread harijay
Hello Albert , Thanks for your pointers I did finally get it to work Here is what worked: script = SYMM %s CELL %s skipline LABOUT H K L FP FOM PHIS X CTYPOUT H H H F W P R FORMAT '(3f4.0,f11.2,f8.2,f8.1,f8.2)' END eof %(options.symm,cellparams) import

soap request includes a hyphenated field, don't know how to set it

2009-03-27 Thread straycat000
I'm trying to use suds to create a SOAP request. The request includes a hyphenated field. Python won't let me set to hyphenated variables. Is there a way around this? Don't tell me to use an underscore because the SOAP server won't recognize it. The request is supposed to look like this:

Re: Style question - defining immutable class data members

2009-03-27 Thread Steve Holden
John Posner wrote: [snip] If the object is a class instance and the attribute reference occurs on both sides of the assignment operator; for example:: self.x = self.x + 1 ... in the RHS expression, ``self.x`` is evaluated with ``getattr()``,

Re: soap request includes a hyphenated field, don't know how to set it

2009-03-27 Thread Justin Ezequiel
On Mar 27, 3:33 pm, straycat...@yahoo.com wrote: Working my way through suds, I have something like this: event = client.factory.create('ns0:UserVerifiedEvent') print event (UserVerifiedEvent){    event-id = None    user-verified-content[] = empty    domain-specific-attributes =      

Re: soap request includes a hyphenated field, don't know how to set it

2009-03-27 Thread straycat000
On Mar 27, 1:15 am, Justin Ezequiel justin.mailingli...@gmail.com wrote: On Mar 27, 3:33 pm, straycat...@yahoo.com wrote: Working my way through suds, I have something like this: event = client.factory.create('ns0:UserVerifiedEvent') print event (UserVerifiedEvent){    event-id =

modifying a list element from a function

2009-03-27 Thread TP
Hi everybody, Be a the following list, containing list elements which second field is a string. a = [ [4, toto], [5, cou] ] a[0][1]=tou a [[4, 'tou'], [5, 'cou']] OK. Now, I want: * to do the same modification on the list a within a function * not to hardcode in this function the position

Re: Debugging in Py

2009-03-27 Thread Lawson English
Jeremiah Dodds wrote: On Wed, Mar 25, 2009 at 9:25 PM, *nixtechno epctec...@gmail.com mailto:epctec...@gmail.com wrote: Big thanks tkc, and I was wondering what your thoughts are on logging module: http://docs.python.org/library/logging.html Instead of using many print

Re: Threading and tkinter

2009-03-27 Thread Eric Brunel
(Sorry: replying to the wrong message here, but my newsreader somehow managed to miss the former post...) On Mar 7, 9:40 am, Jani Hakala jahak...@iki.fi wrote: After reading the docs and seeing a few examples i think this should work ? Am I forgetting something here or am I doing something

Re: split string at commas respecting quotes when string not in csv format

2009-03-27 Thread Tim Chase
import re s = a=1,b=0234,)#($)@, k=7 rx = re.compile(r'[ ]*(\w+)=([^,]+|[^]*)[ ]*(?:,|$)') rx.findall(s) [('a', '1'), ('b', '0234,)#($)@'), ('k', '7')] rx.findall('a=1, *DODGY*SYNTAX* b=2') [('a', '1'), ('b', '2')] I'm going to save this one and study it, too. I'd like to learn

control device via USB or Parallel

2009-03-27 Thread alejandro
Some guy will make switches that can be controlled via USB or parallel, he told me that I can chose which connection I want. So, are there any modules for Python that will allow me to control some switches via USB or parallel? -- http://mail.python.org/mailman/listinfo/python-list

Re: Async serial communication/threads sharing data

2009-03-27 Thread JanC
Jean-Paul Calderone wrote: These days, serial ports are on the way out, I think. I don't see generic USB and bluetooth serial devices disappear that fast... E.g. AFAIK (almost?) all GPS receivers have to be accessed as serial devices (mine even looks like a generic USB-to-serial device to the

please include python26_d.lib in the installer

2009-03-27 Thread Compie
I get this linker error LINK : fatal error LNK1104: cannot open file 'python26_d.lib' when I build the debug version of my Visual Studio project. This is caused by the following lines in the file c:\Python26\include \pyconfig.h # ifdef _DEBUG #

Re: modifying a list element from a function

2009-03-27 Thread Peter Otten
TP wrote: Hi everybody, Be a the following list, containing list elements which second field is a string. a = [ [4, toto], [5, cou] ] a[0][1]=tou a [[4, 'tou'], [5, 'cou']] OK. Now, I want: * to do the same modification on the list a within a function * not to hardcode in this

Re: modifying a list element from a function

2009-03-27 Thread Kent
* to do the same modification on the list a within a function * not to hardcode in this function the position of the string in each a = [ [4, toto], [5, cou] ] def assign(element,pos,newValue): ... element[pos]=newValue ... assign(a[0],1,'xxx') print a [[4, 'xxx'], [5, 'cou']] does

Re: C extension using GSL

2009-03-27 Thread sturlamolden
On Mar 27, 7:10 am, jesse jberw...@gmail.com wrote: I give up. I cannot find my memory leak! That's the penalty for using the Python C API. http://www.cython.org -- http://mail.python.org/mailman/listinfo/python-list

Re: dict view to list

2009-03-27 Thread alex23
On Mar 27, 3:44 pm, Aaron Brady castiro...@gmail.com wrote: Is there a possibility of the dict_values, dict_items, and dict_keys objects growing a 'tolist' method?  It's one of those little things that contributes to one's user experience. Probably not, because the Python approach is to use

Re: Characters aren't displayed correctly

2009-03-27 Thread J. Clifford Dyer
On Mon, 2009-03-02 at 06:16 -0800, Hussein B wrote: On Mar 2, 4:03 pm, J. Clifford Dyer j...@sdf.lonestar.org wrote: On Mon, 2009-03-02 at 00:33 -0800, Hussein B wrote: On Mar 1, 11:27 pm, J. Clifford Dyer j...@sdf.lonestar.org wrote: On Sun, 2009-03-01 at 09:51 -0500, Philip Semanchuk

Re: modifying a list element from a function

2009-03-27 Thread Adrian Dziubek
Could you explain your high level goal for this? It looks like a very wicked way of doing things. Have You tried to read the list methods' documentation? Maybe there you find something you need (like list.index)? -- Adrian -- http://mail.python.org/mailman/listinfo/python-list

Re: imported module scitools not recognized

2009-03-27 Thread martine de vos
Thanks for your help and explanation. I am now able to use modules from scitools. Martine On 26 mrt, 21:39, Terry Reedy tjre...@udel.edu wrote: Robert Kern wrote: On 2009-03-26 10:42, mgdevos wrote: Hi all, I have installed thescitoolsmodule but modules included inscitools, for

Re: split string at commas respecting quotes when string not in csv format

2009-03-27 Thread John Machin
On Mar 27, 9:19 pm, Tim Chase python.l...@tim.thechases.com wrote:   import re   s = a=1,b=0234,)#($)@, k=7   rx = re.compile(r'[ ]*(\w+)=([^,]+|[^]*)[ ]*(?:,|$)')   rx.findall(s)  [('a', '1'), ('b', '0234,)#($)@'), ('k', '7')]   rx.findall('a=1, *DODGY*SYNTAX* b=2')  [('a', '1'),

Re: split string at commas respecting quotes when string not in csv format

2009-03-27 Thread Paul McGuire
On Mar 27, 5:19 am, Tim Chase python.l...@tim.thechases.com wrote:   import re   s = a=1,b=0234,)#($)@, k=7   rx = re.compile(r'[ ]*(\w+)=([^,]+|[^]*)[ ]*(?:,|$)')   rx.findall(s)  [('a', '1'), ('b', '0234,)#($)@'), ('k', '7')]   rx.findall('a=1, *DODGY*SYNTAX* b=2')  [('a', '1'),

Re: dict view to list

2009-03-27 Thread Aaron Brady
On Mar 27, 7:14 am, alex23 wuwe...@gmail.com wrote: On Mar 27, 3:44 pm, Aaron Brady castiro...@gmail.com wrote: Is there a possibility of the dict_values, dict_items, and dict_keys objects growing a 'tolist' method?  It's one of those little things that contributes to one's user

Re: how to arrange classes in .py files?

2009-03-27 Thread David L. Jones
On Mar 26, 8:51 pm, Kent kent.y...@gmail.com wrote: ... Is there any convention how to manage python classes into .py files? ... In above packages, each .py file contains one python class. And ClassName = Filename ... Can anyone give some hint on it? would be great with reason. Overall,

Re: modifying a list element from a function

2009-03-27 Thread Aaron Brady
On Mar 27, 4:39 am, TP tribulati...@paralleles.invalid wrote: Hi everybody, Be a the following list, containing list elements which second field is a string. a = [ [4, toto], [5, cou] ] a[0][1]=tou a [[4, 'tou'], [5, 'cou']] OK. Now, I want: * to do the same modification on the

Re: split string at commas respecting quotes when string not in csv format

2009-03-27 Thread Tim Chase
Paul McGuire wrote: On Mar 27, 5:19 am, Tim Chase python.l...@tim.thechases.com wrote: import re s = a=1,b=0234,)#($)@, k=7 rx = re.compile(r'[ ]*(\w+)=([^,]+|[^]*)[ ]*(?:,|$)') rx.findall(s) [('a', '1'), ('b', '0234,)#($)@'), ('k', '7')] rx.findall('a=1, *DODGY*SYNTAX* b=2')

Re: Python AppStore / Marketplace

2009-03-27 Thread Daniel Fetchinson
I think Marcel has a point... Much can be done and should be done to improve packaging and applications for python. That's why I for one am working on the python package manager project. On sourceforge. It uses the pypi interface to search. Actually we haven't made a release yet. Still

Re: C extension using GSL

2009-03-27 Thread Nick Craig-Wood
jesse jberw...@gmail.com wrote: I give up. I cannot find my memory leak! I'm hoping that someone out there has come across something similar. Let me lay out the basic setup: I'm performing multiple simulations on a model. Each iteration involves solving a system of differential

Re: C extension using GSL

2009-03-27 Thread jesse
On Mar 27, 9:30 am, Nick Craig-Wood n...@craig-wood.com wrote: jesse jberw...@gmail.com wrote:  I give up. I cannot find my memory leak! I'm hoping that someone out  there has come across something similar. Let me lay out the basic  setup:  I'm performing multiple simulations on a model.

Re: Programming Python 4th Edition?

2009-03-27 Thread pruebauno
On Mar 26, 10:08 pm, Esmail ebo...@hotmail.com wrote: Hi, Does anyone know if there is a 4th edition of this book planned and if so, when it might be coming out? It looks like a good and comprehensive book but is getting a bit outdated(?). And I guess since I'm asking this, I might as

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Carl Banks
On Mar 26, 11:02 pm, Paul Rubin http://phr...@nospam.invalid wrote: Dennis Lee Bieber wlfr...@ix.netcom.com writes: ...        v = theDict.get(x, NOT_RELEVANT) ...        if v is not NOT_RELEVANT: ...                print x, v I think you'd normally do this with      if x in theDict:  

Re: please include python26_d.lib in the installer

2009-03-27 Thread Carl Banks
On Mar 27, 1:48 am, Compie joh...@gmail.com wrote: I get this linker error LINK : fatal error LNK1104: cannot open file 'python26_d.lib' when I build the debug version of my Visual Studio project. This is caused by the following lines in the file c:\Python26\include \pyconfig.h #            

Re: Programming Python 4th Edition?

2009-03-27 Thread Esmail
prueba...@latinmail.com wrote: It isn't a introduction to the Python language like Learning Python, it doesn't work as reference like Python in a Nutshell, it doesn't contain short idiomatic code like Python Cookbook. What you are left with is different application domains and how to apply

c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article mailman.2130.1237391000.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: you are trying to do very deep things that most people do not do with python. that does not mean that there are no solutions, just that you have to find them yourself (especially with the

Re: dict view to list

2009-03-27 Thread Miles
On Fri, Mar 27, 2009 at 9:58 AM, Aaron Brady wrote: The suggestion is entirely a look and feel observation.  In an interactive session, to examine the contents of a dictionary I've just created, I need to type list(_), and lose the previous return value. It's a better for my anecdote train of

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread andrew cooke
Aahz wrote: Excuse me? What decline of this newsgroup? Hmmm. It's hard to respond to this without implicitly criticising others here, which wasn't my point at all. But my personal impression is that over the years various people who used to post here now stay pretty firmly in the dev group,

Interfacing python and C

2009-03-27 Thread steve William
Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: *#include stdio.h int fact(int n) { if (n = 1) return 1; else

Interfacing python and C

2009-03-27 Thread steve William
Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: *#include stdio.h int fact(int n) { if (n = 1) return 1; else

Re: Interfacing python and C

2009-03-27 Thread MRAB
steve William wrote: Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: /#include stdio.h int fact(int n) { if (n

Re: Python-list Digest, Vol 66, Issue 527

2009-03-27 Thread steve William
steve William wrote: Hi All, I'm using SWIG for the first time and I am facing some problems with user defined header files. I'm trying to use my own header file in a C program which would be interfaced with python. The header file is test.h: /#include stdio.h int fact(int n) {

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article mailman.2787.1238174158.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: Aahz wrote: Excuse me? What decline of this newsgroup? Hmmm. It's hard to respond to this without implicitly criticising others here, which wasn't my point at all. But my personal

is there a way to collect twitts with python?

2009-03-27 Thread '2+
i found a guy twittin supercollider code this means his followers can listen to a noiz by activating that 1 line (well if he has sc installed) if lots of sc users start twittin ... it would be no good to follow each collecting a sc related twitt can be done with python? if there's a lib already

Re: is there a way to collect twitts with python?

2009-03-27 Thread Aahz
In article mailman.2793.1238176502.11746.python-l...@python.org, '2+ electriclighthe...@gmail.com wrote: [...] This is for upperclass twit of the year, right? -- Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/ At Resolver we've found it useful to short-circuit any

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Tim Chase
Aahz wrote: In article mailman.2130.1237391000.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: you are trying to do very deep things that most people do not do with python. that does not mean that there are no solutions, just that you have to find them yourself (especially

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread skip
Aahz Excuse me? What decline of this newsgroup? Andrew But my personal impression is that over the years various Andrew people who used to post here now stay pretty firmly in the dev Andrew group, while others seem to have disappeared more or less Andrew completely

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Paul Rubin
Carl Banks pavlovevide...@gmail.com writes:      if x in theDict:           print x, v Where does v come from? Oops, pasted from original. Meant of course print x, theDict[x]. -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a way to collect twitts with python?

2009-03-27 Thread Grant Edwards
On 2009-03-27, '2+ electriclighthe...@gmail.com wrote: I've found that C# is much better at collecting twits... ducks -- Grant Edwards grante Yow! at

Re: smtplib problem with newly rebuilt Debian/lenny system

2009-03-27 Thread Aahz
[posted e-mailed, please respond to newsgroup] In article d37a66e9-55c2-437c-b613-009a62f71...@d2g2000pra.googlegroups.com, cassiope f...@u.washington.edu wrote: In attempting to diagnose the cause, I tried directly executing the lines inside the python2.5 interpreter: import smtplib

Find duplicates in a list/array and count them ...

2009-03-27 Thread Paul . Scipione
Hello, I'm a newbie to Python. I wrote a Python script which connect to my Geodatabase (ESRI ArcGIS File Geodatabase), retrieves the records, then proceeds to evaluate which ones are duplicated. I do this using lists. Someone suggested I use arrays instead. Below is the content of my

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Carl Banks
On Mar 27, 11:20 am, Paul Rubin http://phr...@nospam.invalid wrote: Carl Banks pavlovevide...@gmail.com writes:      if x in theDict:           print x, v Where does v come from? Oops, pasted from original.  Meant of course print x, theDict[x]. You have look up x twice with that code,

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 10:47 -0700, Aahz wrote: In article mailman.2787.1238174158.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: Aahz wrote: Excuse me? What decline of this newsgroup? Hmmm. It's hard to respond to this without implicitly criticising others here,

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread skip
Albert For me declining means the rate of (non-spam) posts is steadily Albert dropping over time. I know this wasn't the main point of your post, but if you subscribe to python-list@python.org or read it via a mail-to-news gateway like Gmane I think you will find the ratio of spam to ham

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Nick Craig-Wood
Aahz a...@pythoncraft.com wrote: Well, yes, but that's simply the nature of online fora (I originally wrote nature of Usenet, but I think it's more general than that). From my POV, if you're going to call it a decline, you need to provide more evidence than some people leaving and others

Re: Find duplicates in a list/array and count them ...

2009-03-27 Thread MRAB
paul.scipi...@aps.com wrote: Hello, I'm a newbie to Python. I wrote a Python script which connect to my Geodatabase (ESRI ArcGIS File Geodatabase), retrieves the records, then proceeds to evaluate which ones are duplicated. I do this using lists. Someone suggested I use arrays instead.

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Peter Otten
Mudcat wrote: I would like to use a dictionary to store byte table information to decode some binary data. The actual number of entries won't be that large, at most 10. That leaves the other 65525 entries as 'reserved' or 'other' but still need to be somehow accounted for when referenced.

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Duncan Booth
Carl Banks pavlovevide...@gmail.com wrote: On Mar 27, 11:20 am, Paul Rubin http://phr...@nospam.invalid wrote: Carl Banks pavlovevide...@gmail.com writes:      if x in theDict:           print x, v Where does v come from? Oops, pasted from original.  Meant of course print x,

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article slrngsq9rb.uia.n...@irishsea.home.craig-wood.com, Nick Craig-Wood n...@craig-wood.com wrote: c.l.py is my favourite usenet group and has been for some time. I've been doing usenet for 16 years now! Newbie. ;-) -- Aahz (a...@pythoncraft.com) *

Re: how to arrange classes in .py files?

2009-03-27 Thread Kent
On Mar 27, 3:01 pm, David L. Jones david.l.jo...@gmail.com wrote: On Mar 26, 8:51 pm, Kent kent.y...@gmail.com wrote: ... Is there any convention how to manage python classes into .py files? ... In above packages, each .py file contains one python class. And ClassName = Filename

Re: Calendar module: HTMLCalendar overrides style sheet settings

2009-03-27 Thread Sibylle Koczian
Terry Reedy schrieb: Calendar is an ancient and not-well-maintained module which may even predate html. (There have even been suggestions that it be dropped.) I would not be surprised if the 'css' parameter of formatyearpage were an incomplete addition to the first version of HTMLCalendar.

Re: how to arrange classes in .py files?

2009-03-27 Thread Michael Torrie
Kent wrote: In java, usually a .java file contains One Class. I read some python codes, I found one py file can have many classes and functions. Is there any convention how to manage python classes into .py files? In python we have a real name space, the primary unit being the module. Think

Re: C extension using GSL

2009-03-27 Thread Gabriel Genellina
En Fri, 27 Mar 2009 03:10:06 -0300, jesse jberw...@gmail.com escribió: I give up. I cannot find my memory leak! I'm hoping that someone out there has come across something similar. Let me lay out the basic setup: [...] 4) C: A PyList object, L, is created (new reference!). This will hold the

Re: dict view to list

2009-03-27 Thread Luis Gonzalez
Yes, I know the python approach is to use built-ins. But wouldn't it be cool if we could do mydict.values().tolist() instead? It would be more regular and intuitive and readable from an OO point of view. In my oppinion, this would be cleaner. Built-ins used like this look like an early decission

Python Tk Tix GUI documentation builder overview and tips

2009-03-27 Thread baloand
I have recently started development for a small video conversion project using a GUI. After some research I decided to use Tkinter/Tix (Tk/Tix). The reasons are mainly: 1. the GUI is rather simple, and 2. the end-user is not necessarily technically inclined so I want to keep a) required

~/.local not in sys.path?

2009-03-27 Thread skip
I don't see ~/.local in sys.path. Is this some feature which needs to be enabled? I was kind of unclear after reading the section on it in the 2.6 What's New document. Thx, -- Skip Montanaro - s...@pobox.com - http://www.smontanaro.net/ -- http://mail.python.org/mailman/listinfo/python-list

UnicodeEncodeError - opening encoded URLs

2009-03-27 Thread D4rko
Hi! I have a problem with urllib2 open() function. My application is receiving the following request - as I can see in the developement server console it is properly encoded: [27/Mar/2009 22:22:29] GET /[blahblah]/Europa_%C5%9Arodkowa/5 HTTP/ 1.1 500 54572 Then it uses this request parameter as

Python print and types selection

2009-03-27 Thread mark . seagoe
Python 2.5, PC. I have a question about getting Python print to be able to recognize a long type. class bignumber(object): def __init__(self, initval=0): self.val = initval # def __int__(self): print 'bignumber.__int__ returning a %s' % type(self.val) return

Accessing wx.TextCtrl after refactoring

2009-03-27 Thread alex
Hi all I am working on a Dialog window for a gui in wxPython and started refactoring it, below code is a simplified version of it. def createInput1 should create a static text, a button and a textcontrol using the information in def box1Labels. def makeStaticBox1 then arranges all widgets in

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
What I mean is, is there a way to change the class so that print will see it as a long, without having to cast it as one in the main program. -- http://mail.python.org/mailman/listinfo/python-list

Problems with background processes on Windows

2009-03-27 Thread geoff . bache
Hi all, The following code behaves differently on Windows and Linux using Python 2.5.2. The Linux behaviour is what I expect in both places :) Perhaps somebody could help explain this. Or maybe it is a Python bug. Or a Windows feature... communicate.py --- import subprocess p =

Re: UnicodeEncodeError - opening encoded URLs

2009-03-27 Thread Matt Nordhoff
D4rko wrote: Hi! I have a problem with urllib2 open() function. My application is receiving the following request - as I can see in the developement server console it is properly encoded: [27/Mar/2009 22:22:29] GET /[blahblah]/Europa_%C5%9Arodkowa/5 HTTP/ 1.1 500 54572 Then it uses

Re: UnicodeEncodeError - opening encoded URLs

2009-03-27 Thread D4rko
(Unless name is a unicode object as well.) Unfortunately it is, it's the argument that is automagically handed to the handler function by the Django URL dispatcher. I guess I may need to encode it back to the pure ascii with the %xx things, but I can't find the function that would do it. Any

Re: Python print and types selection

2009-03-27 Thread Gabriel Genellina
En Fri, 27 Mar 2009 18:43:16 -0300, mark.sea...@gmail.com escribió: Python 2.5, PC. I have a question about getting Python print to be able to recognize a long type. [...] print 'TEST 3' bird = bignumber(dog) print 'type(bird) = %s' % type(bird) print 'bird val = 0x%016X' % long(bird) print

Re: Python print and types selection

2009-03-27 Thread Miles
On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: En Fri, 27 Mar 2009 18:43:16 -0300, mark.sea...@gmail.com escribió: Python print recognizes the local constant dog, but it goes and fetches the __int__ type from my object-based class, even though it's value is a long.  Then Python

Re: please include python26_d.lib in the installer

2009-03-27 Thread Mark Hammond
Please note: I want to build my own code in Debug mode for debugging. I don't want to build or use the debug version of Python. I also can't Python does this on purpose so you don't accidentally mix different versions of the C runtime library. This would happen ff you defined DEBUG in your

Re: dict view to list

2009-03-27 Thread Terry Reedy
Luis Gonzalez wrote: Yes, I know the python approach is to use built-ins. But wouldn't it be cool if we could do mydict.values().tolist() instead? Should we also give every collection a .toset(), .tofrozenset(), .totuple(), and .todict() method? This way lies the madness of combinatorial

Re: how to arrange classes in .py files?

2009-03-27 Thread Terry Reedy
Kent wrote: thanks you guys' explaination. I did some refactory on my codes. Now it look's like: myapp/ # this is a package, it is the root package - gui/ # this is package, contains all gui related modules - mainFrame.py - dao.py # all daos are in this module - service.py #

Re: Accessing wx.TextCtrl after refactoring

2009-03-27 Thread Rhodri James
On Fri, 27 Mar 2009 21:51:19 -, alex ale...@bluewin.ch wrote: Hi all I am working on a Dialog window for a gui in wxPython and started refactoring it, below code is a simplified version of it. def createInput1 should create a static text, a button and a textcontrol using the information in

Re: Python print and types selection

2009-03-27 Thread Terry Reedy
Miles wrote: On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: En Fri, 27 Mar 2009 18:43:16 -0300, mark.sea...@gmail.com escribió: Python print recognizes the local constant dog, but it goes and fetches the __int__ type from my object-based class, even though it's value is a long.

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Erik Max Francis
Albert Hopkins wrote: I agree. If the argument is simply that some devs no longer hang here but do on -dev than that's not declining to me, especially as the amount of traffic on -dev increases. That's ordinary. Same for people coming and going. For me declining means the rate of (non-spam)

pyqt drop to open a file

2009-03-27 Thread rui . li . spam
Hi, anyone can give a simple example or a link on how to use 'drop' with pyqt. what I'm looking for is drop a file to main widget then program get the path\filename something like: main_widget set to accept 'drop event', set filename when 'drop event happens' then the filename is path\filename

Re: how do you prevent distutils from downloading and building packages without consent?

2009-03-27 Thread Gabriel Genellina
En Thu, 26 Mar 2009 07:59:15 -0300, lkcl luke.leigh...@googlemail.com escribió: a number of people using pyjamas are not only encountering difficulties with setup.py endeavouring to download and install setuptools but also they are ... the best word to use is unfortunately offended - by the

Re: pyqt drop to open a file

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 17:55 -0700, rui.li.s...@gmail.com wrote: Hi, anyone can give a simple example or a link on how to use 'drop' with pyqt. what I'm looking for is drop a file to main widget then program get the path\filename something like: main_widget set to accept 'drop event',

Re: Accessing wx.TextCtrl after refactoring

2009-03-27 Thread Rhodri James
On Sat, 28 Mar 2009 00:51:04 -, Rhodri James rho...@wildebst.demon.co.uk wrote: On Fri, 27 Mar 2009 21:51:19 -, alex ale...@bluewin.ch wrote: Hi all I am working on a Dialog window for a gui in wxPython and started refactoring it, below code is a simplified version of it. def

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Carl Banks
On Mar 27, 1:06 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: Carl Banks pavlovevide...@gmail.com wrote: On Mar 27, 11:20 am, Paul Rubin http://phr...@nospam.invalid wrote: Carl Banks pavlovevide...@gmail.com writes:      if x in theDict:           print x, v Where does v

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread andrew cooke
Erik Max Francis wrote: [...] And made all purdy-like: http://www.alcyone.com/tmp/python-list%20traffic.pdf That's very pretty, but neither the volume of posts, nor the quality of the people posting here is really what I was talking about. I don't think I explained very well, but seeing

Re: Calendar module: HTMLCalendar overrides style sheet settings

2009-03-27 Thread Gabriel Genellina
En Fri, 27 Mar 2009 17:48:33 -0300, Sibylle Koczian nulla.epist...@web.de escribió: Terry Reedy schrieb: Calendar is an ancient and not-well-maintained module which may even predate html. (There have even been suggestions that it be dropped.) (I would prefer it to be moved into the Tools

Re: how do you prevent distutils from downloading and building packages without consent?

2009-03-27 Thread Gabriel Genellina
En Thu, 26 Mar 2009 08:34:58 -0300, John Machin sjmac...@lexicon.net escribió: On Mar 26, 9:59 pm, lkcl luke.leigh...@googlemail.com wrote: a number of people using pyjamas are not only encountering difficulties with setup.py endeavouring to download and install setuptools but also they are

Unladen-Swallow: A faster python

2009-03-27 Thread Luis M . González
This is a new project started by two Google engineers to speed up python: http://code.google.com/p/unladen-swallow/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 4:00 pm, Miles semantic...@gmail.com wrote: On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: En Fri, 27 Mar 2009 18:43:16 -0300, mark.sea...@gmail.com escribió: Python print recognizes the local constant dog, but it goes and fetches the __int__ type from my object-based

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 7:48 pm, mark.sea...@gmail.com wrote: On Mar 27, 4:00 pm, Miles semantic...@gmail.com wrote: On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: En Fri, 27 Mar 2009 18:43:16 -0300, mark.sea...@gmail.com escribió: Python print recognizes the local constant dog, but it

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 21:15 -0400, andrew cooke wrote: [...] c.l.python used to be the core of a community built around a language. It no longer is. It is a very useful place, where some very helpful and knowledgeable people hang out and give advice, but instead of representing the full

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aaron Brady
On Mar 27, 8:15 pm, andrew cooke and...@acooke.org wrote: Erik Max Francis wrote: [...] And made all purdy-like:    http://www.alcyone.com/tmp/python-list%20traffic.pdf That's very pretty, but neither the volume of posts, nor the quality of the people posting here is really what I was

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread andrew cooke
andrew cooke wrote: i don't completely follow what you are doing, but i currently use the following to find a transition in a finite automaton for a regular expression, and i suspect it's similar to what you want. i get the impression the original poster went away, and maybe they just wanted

Re: Any way to use a range as a key in a dictionary?

2009-03-27 Thread Paul Rubin
Carl Banks pavlovevide...@gmail.com writes: Not necessarily: if the hash calculation for x is expensive enough the get version would still be faster. Yeah, the get version with the special marker value is just ugly IMO, as is the version with exceptions. Maybe there should be a two-value

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread skip
Andrew c.l.python used to be the core of a community built around a Andrew language. It no longer is. It is a very useful place, where Andrew some very helpful and knowledgeable people hang out and give Andrew advice, but instead of representing the full interests of the

  1   2   >