Re: Memory Leak after Py_Finalize()

2009-03-27 Thread Gabriel Genellina
En Thu, 26 Mar 2009 14:51:00 -0300, Tom escribió: I have ported Python, numarray and numpy to the PharLap Embedded Operating System. Python 2.5.2 numpy 1.3.0b1 My problem is the massive memory loss coming back after Py_Finalize() when using numpy. I have seen similar posts but am unclear how to

Re: Unladen-Swallow: A faster python

2009-03-27 Thread Tim Roberts
Luis M. González wrote: > >This is a new project started by two Google engineers to speed up >python: >http://code.google.com/p/unladen-swallow/ I read this with a skeptical eye, but they have some very interesting ideas here. IronPython has certainly shown that Python can be successfully implem

Re: Getting the type of an AST Node

2009-03-27 Thread Terry Reedy
Nick Edds wrote: Is there an easy way to figure out what the type of an AST Node is? Specify version. ? If I have a node n, doing type(n) doesn't help because it gives me 'instance'>, Sounds like instances of an old-style class. Gone in 3.0. You might try AST in 3.0 to see what you get.

Re: Help in reading the pdf file

2009-03-27 Thread Gabriel Genellina
En Thu, 26 Mar 2009 18:31:31 -0300, M Kumar escribió: I need to read pdf files and extract data from it, is there any way to do it through python. If you are interested in the text, I'd use ghostscript pdf2text (you may invoke it from inside python). Actually extracting text from a PDF is

Re: Problems with background processes on Windows

2009-03-27 Thread Tim Roberts
geoff.ba...@gmail.com wrote: > >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... >... >On Windows if I run "communi

Re: Import aliases for moving a module?

2009-03-27 Thread Gabriel Genellina
En Thu, 26 Mar 2009 15:23:50 -0300, zopyxfil...@googlemail.com escribió: For a while a maintained a Python package 'foo' with a number of modules (including a nested structure of module). Now the package moved into a namespace package 'a.b.foo'. What is the way to approach making old code work

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

2009-03-27 Thread Aahz
In article , 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 interests of the Python commun

Getting the type of an AST Node

2009-03-27 Thread Nick Edds
Is there an easy way to figure out what the type of an AST Node is? If I have a node n, doing type(n) doesn't help because it gives me , but what I really want is If, or And, or whatever node type the node actually is. I could always just look at n.__repr__(), because the repr for each node type is

Re: file transfer over LAN

2009-03-27 Thread Gabriel Genellina
En Thu, 26 Mar 2009 21:52:18 -0300, MRAB escribió: prakash jp wrote: On generating log file on remote systems(say client), I want to transfer them to the Network Admins(say Server) Computer. In doing so all the contents of the log file r not transfered, only part of the file. f=open(

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

2009-03-27 Thread alex23
On Mar 28, 3:54 am, "'2+" wrote: > i found a guy twittin supercollider code > if there's a lib already any good pointers to start learnin thangs at? http://code.google.com/p/python-twitter/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Ban Xah Lee

2009-03-27 Thread Xah Lee
over the past 15 years, every few months i got emails from authors for permission request of materials on my website. today, while searching for my name on google, i found a result in books.google.com . Out of curiosity, i searched my name in books.google.com, and here's a hilarious result: Machi

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

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

2009-03-27 Thread Paul Rubin
Carl Banks 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 version: found, value =

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: 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" 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 talk

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: 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 wrote: > > > > > > > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > > >> Python print recognizes the local constant "dog", but it goes and > > >> fetches t

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 4:00 pm, Miles wrote: > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > En Fri, 27 Mar 2009 18:43:16 -0300, 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 > >> val

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: 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 escribió: On Mar 26, 9:59 pm, lkcl 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 ... the best word to use is unfortunately "offe

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 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 directory) But the C

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 seei

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 wrote: > Carl Banks wrote: > > On Mar 27, 11:20 am, Paul Rubin wrote: > >> Carl Banks writes: > >> > >      if x in theDict: > >> > >           print x, v > > >> > Where does v come from? > > >> Oops, pasted from original.  Meant of

Re: Accessing wx.TextCtrl after refactoring

2009-03-27 Thread Rhodri James
On Sat, 28 Mar 2009 00:51:04 -, Rhodri James wrote: On Fri, 27 Mar 2009 21:51:19 -, alex 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 butto

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 e

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 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 fact that distutils, in it

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 o

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

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, 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 print doesn

Re: Accessing wx.TextCtrl after refactoring

2009-03-27 Thread Rhodri James
On Fri, 27 Mar 2009 21:51:19 -, alex 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 "def box1Labels"

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

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 co

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, 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 print doesn't exp

Re: Python print and types selection

2009-03-27 Thread Gabriel Genellina
En Fri, 27 Mar 2009 18:43:16 -0300, 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 'bird val = 0x%016X' %

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

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 = subprocess.P

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

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

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 self

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 a

~/.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

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 librari

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 ma

Re: C extension using GSL

2009-03-27 Thread Gabriel Genellina
En Fri, 27 Mar 2009 03:10:06 -0300, jesse 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 solution vector for

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." Thi

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 Kent
On Mar 27, 3:01 pm, "David L. Jones" wrote: > On Mar 26, 8:51 pm, Kent 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 som

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

2009-03-27 Thread Aahz
In article , Nick Craig-Wood 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) <*> http://www.pythoncraft.com/ "At Resolver we've found it useful to short-circuit an

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

2009-03-27 Thread Duncan Booth
Carl Banks wrote: > On Mar 27, 11:20 am, Paul Rubin wrote: >> Carl Banks 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

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: 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. B

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

2009-03-27 Thread Nick Craig-Wood
Aahz 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 arriving. I

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 ha

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 , > andrew cooke 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 impress

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 wrote: > Carl Banks 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, whereas

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 script

Re: smtplib problem with newly rebuilt Debian/lenny system

2009-03-27 Thread Aahz
[posted & e-mailed, please respond to newsgroup] In article , cassiope wrote: > >In attempting to diagnose the cause, I tried directly executing the >lines inside the python2.5 interpreter: > >import smtplib >s= smtplib.SMTP('localhost') > >but the second line causes a tracebac

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

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

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

2009-03-27 Thread Paul Rubin
Carl Banks 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: 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: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Tim Chase
Aahz wrote: In article , andrew cooke 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 decline of this newsgroup). Excuse me? What decline of t

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

2009-03-27 Thread Aahz
In article , '2+ 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 doubt and just refer to comments in code as 'lies'. :-)" --Michael Foord par

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 an

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

2009-03-27 Thread Aahz
In article , andrew cooke 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 impression is that >over the years various people who used to post here

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 >> >> int fact(

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 int fact(int n) { if (n <= 1) re

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 int fact(int n) { if (n <= 1) return 1; else return n

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 int fact(int n) { if (n <= 1) return 1; else return n

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, w

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 train of tho

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

2009-03-27 Thread Aahz
In article , andrew cooke 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 decline of this >newsgroup). Excuse me? What decline of this newsgr

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

Re: please include python26_d.lib in the installer

2009-03-27 Thread Carl Banks
On Mar 27, 1:48 am, Compie 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: 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 wrote: > Dennis Lee Bieber 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: Programming Python 4th Edition?

2009-03-27 Thread pruebauno
On Mar 26, 10:08 pm, Esmail 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 well be askin

Re: C extension using GSL

2009-03-27 Thread jesse
On Mar 27, 9:30 am, Nick Craig-Wood wrote: > jesse 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 > >  involve

Re: C extension using GSL

2009-03-27 Thread Nick Craig-Wood
jesse 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 equations. For this

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 y

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 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: modifying a list element from a function

2009-03-27 Thread Aaron Brady
On Mar 27, 4:39 am, 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 lis

Re: how to arrange classes in .py files?

2009-03-27 Thread David L. Jones
On Mar 26, 8:51 pm, Kent 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, I don't t

Re: dict view to list

2009-03-27 Thread Aaron Brady
On Mar 27, 7:14 am, alex23 wrote: > On Mar 27, 3:44 pm, Aaron Brady 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 th

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

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

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 wrote: > Robert Kern wrote: > > On 2009-03-26 10:42, mgdevos wrote: > >> Hi all, > > >> I have installed thescitoolsmodule but modules included inscitools, > >> for example nu

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: dict view to list

2009-03-27 Thread alex23
On Mar 27, 3:44 pm, Aaron Brady 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 the builtins. I'm no

Re: C extension using GSL

2009-03-27 Thread sturlamolden
On Mar 27, 7:10 am, jesse 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: 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" wrote: > > On Mon, 2009-03-02 at 00:33 -0800, Hussein B wrote: > > > On Mar 1, 11:27 pm, "J. Clifford Dyer" wrote: > > > > On Sun, 2009-03-01 at 09:51 -0500, Philip Semanchuk wrote: > > > > > On Mar 1, 200

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'],

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 functi

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

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

Re: Debugging in Py

2009-03-27 Thread Lawson English
Jeremiah Dodds wrote: On Wed, Mar 25, 2009 at 9:25 PM, *nixtechno > 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 statements for debugging,

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 functio

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 # p

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

  1   2   >