Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread M Jared Finder
Alex Martelli wrote: > Stefan Nobis <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] (Alex Martelli) writes: >> >>> if anonymous functions are available, they're used in even more >>> cases where naming would help >> Yes, you're right. But don't stop here. What about expressions? Many >> people w

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Petr Prikryl
"Alex Martelli" wrote... > Joe Marshall wrote: >... > > If you language allows unnamed integers, unnamed strings, unnamed > > characters, unnamed arrays or aggregates, unnamed floats, unnamed > > expressions, unnamed statements, unnamed argument lists, etc. why > > *require* a name for trivia

Re: Incrementally converting a C app to Python

2006-05-09 Thread G. Monzón
Hi Bjorn, I think the best approach is highly-dependent to your current C application design and "way of doing things". For a type of application you would take the opposite path than for other I thought. Yes I did that one time, but I re-coded all from scratch... and since that I usually do in r

Re: Deferred Evaluation in Recursive Expressions?

2006-05-09 Thread Peter Otten
[EMAIL PROTECTED] wrote: > That's a good fix. But I have misgivngs about needing a global name > registry. I need to support anonymous types and types with local > (lexical) scope. For example: > > def makeAnonymousRecursiveType(T): > # anonymous type expression with local scope > LinkedL

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread G. Monzón
Carl Banks wrote: > G. Monzón wrote: > > Please don't compare PHP with Python... They are very different worlds. > > I'm not. I was simply agreeing that the single executable way the OP > claimed PHP does it can *sometimes* be preferrable in Python, and > giving him recommendations thereto. > > C

Re: Is PythonCard dead?

2006-05-09 Thread Luis M. González
18 months? Wow!.. time flies... Anyway, PythonCard is a fine product, and it's very good just the way it is. It would be great if a new release comes up though... -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread Ravi Teja
Addendum: Python has zip imports (similar to Java's jar files). You can put all your *.py files in a zip file and access them from it if this means so much to you. -- http://mail.python.org/mailman/listinfo/python-list

Re: SciPy - I need an example of use of linalg.lstsq()

2006-05-09 Thread Robert Kern
I. Myself wrote: > And it has to run on Windows, so it can't use xplt. Huh? A. xplt runs on Windows, too. B. xplt has nothing to do with linalg.lstsq(). C. xplt has been removed from scipy. > I would prefer that it use the simplest multi-dimensional model, z = k + > a*x1 + b*x2 + c*x3 + d*x4 I

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread Ravi Teja
PHP and Python are different languages. They do things differently. You are just familiar more with one than the other. Give it some time. The many file approach is the modular design of Python. Having the standard library separate from the main Python DLL is an advantage, not a disadvantage. For

SciPy - I need an example of use of linalg.lstsq()

2006-05-09 Thread I. Myself
And it has to run on Windows, so it can't use xplt. I would prefer that it use the simplest multi-dimensional model, z = k + a*x1 + b*x2 + c*x3 + d*x4 Anyone have such a thing? Thanks, Mitchell Timin -- I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or article

Re: Deferred Evaluation in Recursive Expressions?

2006-05-09 Thread birchb
If we -are- limited to lambdas, I see two options. Either embed lambdas for each circular link, or have the whole expression in one lambda. ie LinkedList3 = (int, lambda: LinkedList3, lambda: TypeNameX) vs LinkedList2 = lambda: (int, LinkedList2, TypeNameX) The second option looks neate

optparse and counting arguments (not options)

2006-05-09 Thread Steven Bethard
I feel like I must be reinventing the wheel here, so I figured I'd post to see what other people have been doing for this. In general, I love the optparse interface, but it doesn't do any checks on the arguments. I've coded something along the following lines a number of times: class Opti

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread Carl Banks
G. Monzón wrote: > Please don't compare PHP with Python... They are very different worlds. I'm not. I was simply agreeing that the single executable way the OP claimed PHP does it can *sometimes* be preferrable in Python, and giving him recommendations thereto. Carl Banks -- http://mail.pyth

Re: Deferred Evaluation in Recursive Expressions?

2006-05-09 Thread birchb
That's a good fix. But I have misgivngs about needing a global name registry. I need to support anonymous types and types with local (lexical) scope. For example: def makeAnonymousRecursiveType(T): # anonymous type expression with local scope LinkedList = (T, lambda: LinkedList) return

Reading Soap struct type

2006-05-09 Thread Thomas Thomas
Hi All, I am receiving a hash below from my Soap Interface : {'Field12value': ':C F3Value', 'Field8': 'Price Text:price_text', 'Field9': 'Text with File:file_text ', 'Field11value': ':CF2Value', 'Field7': 'Product Code:product_code', 'Field7va lue': ':product_values', 'Field2': 'Job Reference:job

Re: __all__ does not work?

2006-05-09 Thread AndyL
[EMAIL PROTECTED] wrote: > Andy> This a mm.py module: > Andy> _all__=('getsize1',) > > Andy> size=85 > > Andy> def getsize1(): > Andy> return size > > Andy> def getsize2(): > Andy> return 2*size > > > Andy> I do not know why but getsize2 is not kept pr

Re: problemi con POST

2006-05-09 Thread Alex Martelli
Heavy <[EMAIL PROTECTED]> wrote: > Ciao a tutti, > sto creando una applicazione in python, che deve fungere anche da > server web... > non ho assolutamente problemi a prendere i parametri di una 'GET', mi > limito a fare il parsing della URL, ma come faccio a prendere i > parametri di una 'POST'?

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread G. Monzón
Please don't compare PHP with Python... They are very different worlds. Maybe not all the Python's core functions are implemented in C, but Python is really a lot more efficient than PHP in every case you want to compare. If you "look inside", there's nothing to compare... they are extremely diff

Matplotlib in Python vs. Matlab, which one has much better graphical pressentation?

2006-05-09 Thread N/A
Hi all, Can I have your opinions on Matlab vs. Matplotlib in Python in terms of 2D and 3D graphical presentation please. Matplotlib in Python vs. Matlab, which one has much better graphical pressentation? -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Alex Martelli
Joe Marshall <[EMAIL PROTECTED]> wrote: > Pisin Bootvong wrote: > > Is this a Slippery Slope fallacious argument? > > (http://c2.com/cgi/wiki?SlipperySlope) > > > > "if python required you to name every function then soon it will > > require you to name every number, every string, every immediate

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > I think it's reasonable to make a name a part of functions, classes and > > modules because they may often be involved in tracebacks (in case of > > uncaught errors): to me, it makes sense to let an error-

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Alex Martelli
Joe Marshall <[EMAIL PROTECTED]> wrote: ... > The problem is that a `name' is a mapping from a symbolic identifier to > an object and that this mapping must either be global (with the > attendant name collision issues) or within a context (with the > attendant question of `in which context'). W

Re: Memory leak in Python

2006-05-09 Thread Karthik Gurusamy
[EMAIL PROTECTED] wrote: > The amount of data I read in is actually small. > > If you see my algorithm above it deals with 2000 nodes and each node > has ot of attributes. > > When I close the program my computer becomes stable and performs as > usual. I check the performance in Performance monito

Is PythonCard dead?

2006-05-09 Thread Steve
There haven't been any updates since version 0.8.1 in October 2004, almost 18 months. And the new book on wxPython doesn't say anything about PythonCard, which I find rather surprising. -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive shell -- reload definitions?

2006-05-09 Thread James Stroud
Metalone wrote: > I have a question about the interactive Python shell. Is it possible > to reload a file and get the new definitions. > > For example, if I do > import xyz > > Then I find a bug in some function in xyz. > So, I edit xyz.py > > I would like to reload the definitions in xyz.py wi

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Paul Rubin
rydis (Martin Rydstr|m) @CD.Chalmers.SE writes: > [Emacs] is written in Lisp, which is the only computer language that is > beautiful. -- Neal Stephenson, _In the Beginning was the Command Line_ I don't remember seeing these lyrics in the thread yet, but obviously it's a requirement: http://www.

Re: Memory leak in Python

2006-05-09 Thread diffuser78
The amount of data I read in is actually small. If you see my algorithm above it deals with 2000 nodes and each node has ot of attributes. When I close the program my computer becomes stable and performs as usual. I check the performance in Performance monitor and using "top" and the total memory

Re: List of lists of lists of lists...

2006-05-09 Thread Robert Kern
James Stroud wrote: > Numarray does this sort of thing, but you have to familiarize yourself > with its indexing conventions: > > py> import numarray > py> numarray.ones((3,2)) > array([[1, 1], > [1, 1], > [1, 1]]) > py> numarray.ones((1,2,3)) > array([[[1, 1, 1], > [1,

Re: __all__ does not work?

2006-05-09 Thread skip
Andy> This a mm.py module: Andy> _all__=('getsize1',) Andy> size=85 Andy> def getsize1(): Andy> return size Andy> def getsize2(): Andy> return 2*size Andy> I do not know why but getsize2 is not kept priviate? That's not what __all__ is used for. Try

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread John Salerno
Gary Herron wrote: > Gary John Salerno wrote: > >> How do you make a single string span multiple lines, but also allow >> yourself to indent the second (third, etc.) lines so that it lines up >> where you want it, without causing the newlines and tabs or spaces to be >> added to the string as w

Re: List of lists of lists of lists...

2006-05-09 Thread James Stroud
Ángel Gutiérrez Rodríguez wrote: > I would like to have a list of lists N times deep, and my solution is (in > pseudocode): > > def deep(x): > a=[x] > return a > > mylist=[] > for N: mylist=deep(mylist) > > Is there a more elegant way to do it? > > The maine idea is: from a list having the

Re: hyperthreading locks up sleeping threads

2006-05-09 Thread Lialie KingMax
I haven't try the files yet. But have got a similar problem before. The situation is nearly the same. Always at random time , it reported that the memory read or write violently.But I use Windows 2000(Python 2.3, wxPython 2.4). Windows issue says 2000 doesn't support HP, so I simply turn it off. I

Re: Enumerating Regular Expressions

2006-05-09 Thread Karthik Gurusamy
[EMAIL PROTECTED] wrote: > James Stroud wrote: > > You see the difficulty don't you? How will the computer know in advance > > that the regex matches only a finite set of possible strings? > > Well sure it might be a little difficult to figure _that_ out, although > probably not all that hard if yo

Re: installing numpy

2006-05-09 Thread Robert Kern
Raymond L. Buvel wrote: > Since you are a new Linux user, you should definitely follow Robert's > advice about building as an ordinary user separately from the install. > I sometimes take a shortcut and just do the install as user root. > However, I then wind up cleaning out the build directory as

Re: installing numpy

2006-05-09 Thread Raymond L. Buvel
Robert Kern wrote: > Gary Wessle wrote: > >>"Raymond L. Buvel" <[EMAIL PROTECTED]> writes: > > >>>When installing from source on a Debian system, you want the installed >>>package to wind up in /usr/local/lib/python2.x/site-packages (where x >>>represents the version of Python you are running th

Re: do "some action" once a minute

2006-05-09 Thread James Stroud
Petr Jakes wrote: > I would like to do "some action" once a minute. My code (below) works, > I just wonder if there is some more pythonic approach or some "trick" > how to do it differently. > > minutes=time.localtime()[4] > while 1: > min, sec = time.localtime()[4:6] > if sec==0 and minu

__all__ does not work?

2006-05-09 Thread AndyL
This a mm.py module: _all__=('getsize1',) size=85 def getsize1(): return size def getsize2(): return 2*size I do not know why but getsize2 is not kept priviate? $ python Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credi

BayPIGgies: May 11, 7:30pm (Google)

2006-05-09 Thread Aahz
The next meeting of BayPIGgies will be Thurs, May 11 at 7:30pm at Google. Note: Dennis Reinhardt is coordinating Google badges. Please send e-mail to [EMAIL PROTECTED] by 4pm Weds 5/10 to get an advance badge. Dennis Reinhardt will present a short tutorial of using ctypes with the Windows API,

Python Game Challenge results (and new hosting) UP!

2006-05-09 Thread Richard Jones
After some problems with hosting which were solved thanks to the PSF the PyWeek site is back. http://www.pyweek.org/ Go see the results of the challenge, in particular the outstanding Nelly's Rooftop Garden and Trip on the Funny Boat. PyWeek challenges entrants to develop a complete game in P

Performance of Blocks in Python

2006-05-09 Thread Dilip
I read a couple of interesting blog posts about the performance of blocks in languages like Ruby, Python here[1] and here[2]. The posts start out questioning Ruby but towards the middle and the end it does draw analogies between python's design decision to introduce 'with' statement as a language

Re: Dictionaries -- ahh the fun.. (newbie help)

2006-05-09 Thread Bruno Desthuilliers
rh0dium a écrit : > Hi all, > > Can someone help me out. I am trying to determing for each run whether > or not the test should pass or fail but I can't seem to access the > results .. > (snip) > cells={} > > cells["NOR3X1"]= { > 'run' : [ 'lvs', 'drc' ], >

Re: Dictionaries -- ahh the fun.. (newbie help)

2006-05-09 Thread Scott David Daniels
rh0dium wrote: > Hi all, > > Can someone help me out. I am trying to determing for each run whether > or not the test should pass or fail but I can't seem to access the > results .. > > Alternatively can someone suggest a better structure ( and a lesson as > to the reasoning ) that would be grea

Re: PyExcelerator: How does one close a file?

2006-05-09 Thread John Machin
On 10/05/2006 7:57 AM, [EMAIL PROTECTED] wrote: > I use PyExcelerator to write data into Excel files, and repeatedly call > the function writeData with different filenames fn from my main > routine. Unfortunately, only one file - the last one - is created. The > problem seems to lie with the fact t

Re: Dictionaries -- ahh the fun.. (newbie help)

2006-05-09 Thread BJörn Lindqvist
> Can someone help me out. I am trying to determing for each run whether > or not the test should pass or fail but I can't seem to access the > results .. > > Alternatively can someone suggest a better structure ( and a lesson as > to the reasoning ) that would be great too!! Flat is better than

Re: Dictionaries -- ahh the fun.. (newbie help)

2006-05-09 Thread James Stroud
rh0dium wrote: > Hi all, > > Can someone help me out. I am trying to determing for each run whether > or not the test should pass or fail but I can't seem to access the > results .. > > Alternatively can someone suggest a better structure ( and a lesson as > to the reasoning ) that would be grea

RE: hyperthreading locks up sleeping threads

2006-05-09 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > Thanks for trying and reporting the results. Both of you and Tim and > Dave have run the .py program now (all on hyper-threaded CPUs) and > none of you were able to reproduce the problem. > > So that indicates that there is something special about our PC. We > are pla

Re: logging module: add client_addr to all log records

2006-05-09 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Hi! > > I'm writing a server and I want to use the logging module for logging > stuff. I want to log all transactions in detail, and if everything goes > haywire I want to know which client did it. Therefore I want to affix > the client address to every single log item.

Re: problemi con POST

2006-05-09 Thread Bruno Desthuilliers
Michael Hobbs a écrit : > Bruno Desthuilliers wrote: > >> Heavy a écrit : >> >> >>> Ciao a tutti, >>> sto creando una applicazione in python, che deve fungere anche da >>> server web... >>> non ho assolutamente problemi a prendere i parametri di una 'GET', mi >>> limito a fare il parsing della U

Re: python rounding problem.

2006-05-09 Thread Dan Bishop
Grant Edwards wrote: > On 2006-05-09, Dan Bishop <[EMAIL PROTECTED]> wrote: > > Grant Edwards wrote: > > ... > >> Did they actually have 60 unique number symbols and use > >> place-weighting in a manner similar to the arabic/indian system > >> we use? > > > > The Bablyonians did use a place-value s

Dictionaries -- ahh the fun.. (newbie help)

2006-05-09 Thread rh0dium
Hi all, Can someone help me out. I am trying to determing for each run whether or not the test should pass or fail but I can't seem to access the results .. Alternatively can someone suggest a better structure ( and a lesson as to the reasoning ) that would be great too!! cells={} cells["NOR3X

Re: What to use for adding syntax for hierarcical trees, metaclasses, tokenize.py or PLY?

2006-05-09 Thread glomde
Thanks, but the thing is that I want to have the syntactical sugar. And I think that you could use elementtree or xist or any other python tree structure module at the bottom. It could be quite generic. And with the syntactical sugar I find it a lot more readable. A little bit like yaml, but you

interactive shell -- reload definitions?

2006-05-09 Thread Metalone
I have a question about the interactive Python shell. Is it possible to reload a file and get the new definitions. For example, if I do import xyz Then I find a bug in some function in xyz. So, I edit xyz.py I would like to reload the definitions in xyz.py without leaving my current shell sessi

PyExcelerator: How does one close a file?

2006-05-09 Thread tkpmep
I use PyExcelerator to write data into Excel files, and repeatedly call the function writeData with different filenames fn from my main routine. Unfortunately, only one file - the last one - is created. The problem seems to lie with the fact that I do not close the existing file before calling the

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread Carl Banks
Jack wrote: > Then again, I do like the Python language. It would be great if > Python (or a variation of Python) can be made the PHP way, one > executable file, and you get everything. True, sometimes it can be a real convenience to have this. There are solutions that implement your solution to

Incrementally converting a C app to Python

2006-05-09 Thread BJörn Lindqvist
Hello. At work I'm the sole maintainer and developer of a medium sized ~50k line C application. The lion share of this app was written before my time so it is pretty hard to read and also contain lots of bugs. I'm contemplating converting the project to Python because I think that, in the long run,

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Martin Rydstr|m
[EMAIL PROTECTED] (Alex Martelli) writes: > Didn't want to trigger some flamewar;-), but, yes, if that was my only > choice, I'd much rather use small, simple Scheme than huge, complicated, > rich, powerful Common Lisp. ((But in this case I'm biased by early > experiences, since when I learned and

Re: problemi con POST

2006-05-09 Thread Michael Hobbs
Bruno Desthuilliers wrote: > Heavy a écrit : > >> Ciao a tutti, >> sto creando una applicazione in python, che deve fungere anche da >> server web... >> non ho assolutamente problemi a prendere i parametri di una 'GET', mi >> limito a fare il parsing della URL, ma come faccio a prendere i >> par

Re: Deferred Evaluation in Recursive Expressions?

2006-05-09 Thread Lonnie Princehouse
The first 'typedef' line will have a NameError when it tries to evaluate LinkedListB -- http://mail.python.org/mailman/listinfo/python-list

Re: problemi con POST

2006-05-09 Thread Bruno Desthuilliers
Heavy a écrit : > Ciao a tutti, > sto creando una applicazione in python, che deve fungere anche da > server web... > non ho assolutamente problemi a prendere i parametri di una 'GET', mi > limito a fare il parsing della URL, ma come faccio a prendere i > parametri di una 'POST'? io cerco di legger

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread Diez B. Roggisch
> With Python, things are really messy. I have to run the installer > to install dozens of directories and hundreds of files, and I don't > really know if all of them are necessary. Plus, lots of libraries > are in .py, which is of course not as efficient/clean as having all > of the core function

Re: installing numpy

2006-05-09 Thread Robert Kern
Gary Wessle wrote: > "Raymond L. Buvel" <[EMAIL PROTECTED]> writes: >>When installing from source on a Debian system, you want the installed >>package to wind up in /usr/local/lib/python2.x/site-packages (where x >>represents the version of Python you are running the installer from). >>This allows

Re: elementtidy, \0 chars and parsing from a string

2006-05-09 Thread Simon Percivall
Well, it seems you can do: parser = elementtidy.TidyHTMLTreeBuilder.TidyHTMLTreeBuilder() parser.feed(your_str) tree = elementtree.ElementTree.ElementTree(element=parser.close()) Look at the parse() method in the ElementTree class. -- http://mail.python.org/mailman/listinfo/python-list

problemi con POST

2006-05-09 Thread Heavy
Ciao a tutti, sto creando una applicazione in python, che deve fungere anche da server web... non ho assolutamente problemi a prendere i parametri di una 'GET', mi limito a fare il parsing della URL, ma come faccio a prendere i parametri di una 'POST'? io cerco di leggere dal socket di lettura 'rfi

Re: ascii to latin1

2006-05-09 Thread richie
[Luis] > The script converted the ÇÃ from the first line, but not the º from > the second one. That's because º, 0xba, MASCULINE ORDINAL INDICATOR is classed as a letter and not a diacritic: http://www.fileformat.info/info/unicode/char/00ba/index.htm You can't encode it in ascii because it's n

elementtidy, \0 chars and parsing from a string

2006-05-09 Thread Steven Bethard
So I see that elementtidy doesn't like strings with \0 characters in them: >>> import urllib >>> from elementtidy import TidyHTMLTreeBuilder >>> url = 'http://news.bbc.co.uk/1/hi/world/europe/492215.stm' >>> url_file = urllib.urlopen(url) >>> tree = TidyHTMLTreeBuilder.parse(url_file) Traceba

Re: Shadow Detection?

2006-05-09 Thread Gary Herron
Michael Yanowitz wrote: >Hello: > > Many times, people are warning things like >"Don't use 'str' as a variable name as it will shadow the >built in str function." > Is there some way to determine if a string is already >defined in some higher scope? >Maybe something like > > >if isdefined ('st

Re: installing numpy

2006-05-09 Thread Gary Wessle
"Raymond L. Buvel" <[EMAIL PROTECTED]> writes: > Gary Wessle wrote: > > Hi > > > > I am trying to install NumPy in my debian/testing linux > > 2.6.15-1-686. > > > > > When installing from source on a Debian system, you want the installed > package to wind up in /usr/local/lib/python2.x/site-p

Re: Is Welfare Part of Capitalism?

2006-05-09 Thread Rune Strand
Welfare is not a built-in, but in some distributions it's available as a module. Just type import Welfare. However, be aware of the Welfare.division() queerness. It won't be fixed until the Python 3000 is a fact. There is also some issues with the garbage collection. Under certain circumstances the

Re: ascii to latin1

2006-05-09 Thread Peter Otten
Luis P. Mendes wrote: > The script converted the ÇÃ from the first line, but not the º from the > second one. Still in *, I also don't get a list as [115448,DAÇÃO] but a > [u'115448,DAÇÃO'] element, which doesn't suit my needs. > > Would you mind telling me what should I change? Sometimes you a

Re: Shadow Detection?

2006-05-09 Thread [EMAIL PROTECTED]
Carl J. Van Arsdall wrote: > Michael Yanowitz wrote: > > Hello: > > > > Many times, people are warning things like > > "Don't use 'str' as a variable name as it will shadow the > > built in str function." > >Is there some way to determine if a string is already > > defined in some higher sco

Re: Shadow Detection?

2006-05-09 Thread Carl J. Van Arsdall
Michael Yanowitz wrote: > Hello: > > Many times, people are warning things like > "Don't use 'str' as a variable name as it will shadow the > built in str function." >Is there some way to determine if a string is already > defined in some higher scope? > Maybe something like > > > if isdefi

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread Rene Pijlman
Jack: >I have to run the installer to install dozens of directories and >hundreds of files, That's not unusual and not considered a problem by most people. >and I don't really know if all of them are necessary. Don't let that bother you. Life's too short. >Plus, lots of libraries are in .py,

Re: Upgrading Class Instances Automatically on Reload

2006-05-09 Thread malv
Indeed, as I indicated the old recipe/160164 by Michael Hudson works flawlessly for me. I am referring here to the latest edition: cookbook #2 which features an upgraded version. You find the examples in: http://examples.oreilly.com/pythoncook2/cb2_examples.zip The files are named cb2_6_21_*.py,

Re: Enumerating Regular Expressions

2006-05-09 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hi all, > > Does anybody know of a module that allows you to enumerate all the > strings a particular regular expression describes? Make a generator that yields *all* strings in your chosen alphabet (see the monthly threads about permutations and combinations for hints

Shadow Detection?

2006-05-09 Thread Michael Yanowitz
Hello: Many times, people are warning things like "Don't use 'str' as a variable name as it will shadow the built in str function." Is there some way to determine if a string is already defined in some higher scope? Maybe something like if isdefined ('str'): print 'str is already define

Re: Econometrics in Panel data?

2006-05-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, I counseled: >In article <[EMAIL PROTECTED]>, >DeepBlue <[EMAIL PROTECTED]> wrote: >>so are you saying that Python is not an appropriate language for doing >>econometrics stuff? >> >> >>Dennis Lee Bieber wrote: >>> On Tue, 09 May 2006 05:58:10 +0800, DeepBlue <[EMA

Re: Upgrading Class Instances Automatically on Reload

2006-05-09 Thread Rene Pijlman
malv: >At the statement b = Bar(), the following error occurs: >The debugged program raised the exception unhandled AttributeError >"type object 'Bar' has no attribute '__instance_refs__'" I haven't studied it at all, but the code on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 s

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > I think it's reasonable to make a name a part of functions, classes and > modules because they may often be involved in tracebacks (in case of > uncaught errors): to me, it makes sense to let an error-diagnosing > tracebacks display packages, modules, cla

Re: Is Welfare Part of Capitalism?

2006-05-09 Thread Tim Daneliuk
[EMAIL PROTECTED] wrote: > This article is dedicated to: > But I am still confused: Is this a statement or an expression? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to recast integer to a string

2006-05-09 Thread Christoph Haas
On Tue, May 09, 2006 at 12:34:05PM -0700, James wrote: > > Christoph Haas wrote: > > On Tue, May 09, 2006 at 12:17:34PM -0700, James wrote: > > > How to recast an integer to a string? > > > > > > something like > > > n = 5 > > > str = str + char(n) > > > > str(n) > > > > Kindly > > Christoph > >

Re: Calling python functions from C

2006-05-09 Thread Ronny Mandal
On 9 May 2006 10:05:48 -0700, [EMAIL PROTECTED] wrote: >I am a newbie to Python. I want to call python functions from C. I >looked for examples but I couldn't get any simple one. Lets say my >python code is : >def add(a,b) > return (a+b) > >I want to call add from C. Could anybody please help

Re: How to recast integer to a string

2006-05-09 Thread Fredrik Lundh
James wrote: > > > How to recast an integer to a string? > > > > > > something like > > > n = 5 > > > str = str + char(n) > > > > str(n) > > > > Kindly > > Christoph > > In python2,4, I 've got > TypeError: 'str' object is not callable if you want to use a builtin function, you cannot use the sa

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread Gary Herron
Gary John Salerno wrote: >How do you make a single string span multiple lines, but also allow >yourself to indent the second (third, etc.) lines so that it lines up >where you want it, without causing the newlines and tabs or spaces to be >added to the string as well? > >Example (pretend this i

Re: python rounding problem.

2006-05-09 Thread Grant Edwards
On 2006-05-09, Dan Bishop <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > ... >> Did they actually have 60 unique number symbols and use >> place-weighting in a manner similar to the arabic/indian system >> we use? > > The Bablyonians did use a place-value system, but they only had two > basic

Re: Econometrics in Panel data?

2006-05-09 Thread Robert Kern
DeepBlue wrote: > so are you saying that Python is not an appropriate language for doing > econometrics stuff? Alan Isaac certainly thinks it is appropriate and lists many Python resources for econometrics: http://www.american.edu/econ/pytrix/pytrix.htm You may also want to look at QuantLib,

Re: How to recast integer to a string

2006-05-09 Thread Larry Bates
James wrote: > How to recast an integer to a string? > > something like > n = 5 > str = str + char(n) > > > J.L > Two items: 1) Never use 'str' as a variable name as it will shadow the built in str function. If you do, this WILL jump up and bite you. 2) Either s=str(n) or s="%i" % n will ret

Re: Can Python installation be as clean as PHP?

2006-05-09 Thread malv
If this bothers you, why don't you stick to a linux distro with Python installed. Very few don't. -- http://mail.python.org/mailman/listinfo/python-list

Re: python rounding problem.

2006-05-09 Thread Dan Bishop
Grant Edwards wrote: ... > Did they actually have 60 unique number symbols and use > place-weighting in a manner similar to the arabic/indian system > we use? The Bablyonians did use a place-value system, but they only had two basic numerals: a Y-like symbol for 1 and a <-like symbol for ten. Thes

Re: Progress bar in web-based ftp?

2006-05-09 Thread Larry Bates
CatDude wrote: > I've got an application that prompts the user to select a file from his > local computer, checks the user's selection, then sends the file via > enctype="multipart/form-data"> > > In the python code that receives the files I've got a section that does > the following: > >

Re: How to recast integer to a string

2006-05-09 Thread Grant Edwards
On 2006-05-09, James <[EMAIL PROTECTED]> wrote: > How to recast an integer to a string? > something like > n = 5 > str = str + char(n) str = str + chr(5) -- Grant Edwards grante Yow! I want EARS! I at want two ROUND

Re: python rounding problem.

2006-05-09 Thread Grant Edwards
On 2006-05-09, Thomas Bartkus <[EMAIL PROTECTED]> wrote: >>> Even base 60 makes more sense if you like it when a lot of >>> divisions come out nice and even. >> >> Did they actually have 60 unique number symbols and use >> place-weighting in a manner similar to the arabic/indian >> system we use?

Re: Upgrading Class Instances Automatically on Reload

2006-05-09 Thread malv
Rene, No, I couldn't get it to work. Sorry, I should have included that information. At the statement b = Bar(), the following error occurs: The debugged program raised the exception unhandled AttributeError "type object 'Bar' has no attribute '__instance_refs__'" malv -- http://mail.python.o

Re: How to recast integer to a string

2006-05-09 Thread James
Christoph Haas wrote: > On Tue, May 09, 2006 at 12:17:34PM -0700, James wrote: > > How to recast an integer to a string? > > > > something like > > n = 5 > > str = str + char(n) > > str(n) > > Kindly > Christoph In python2,4, I 've got TypeError: 'str' object is not callable J.L -- http://ma

Can Python installation be as clean as PHP?

2006-05-09 Thread Jack
I like Python but I don't really like Python's installation. With PHP, I only need one file (on Linux) and maybe two files on Windows then I can run my PHP script. This means no installation is required in most cases. I just copy the file and I get PHP. Extending PHP is fairly easy, too, just by co

Re: installing numpy

2006-05-09 Thread Robert Kern
Christoph Haas wrote: > Yes, you are right. "python-numeric" refers to NumPy but contains the > "Numeric" version of it (24-2). It's pretty misleading. It's an unfortunate consequence of letting software packages acquire nicknames. C.f.: http://www.scipy.net/pipermail/scipy-user/2006-May/00784

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread John Salerno
Scott David Daniels wrote: > John Salerno wrote: >> How do you make a single string span multiple lines, but also allow >> yourself to indent the second ... without causing the newlines and >> tabs or spaces to be added to the string as well? > > >> self.DTD = '''>"http://www.w3.org/

Re: installing numpy

2006-05-09 Thread Robert Kern
Christoph Haas wrote: > P.S.: Your mail client seems break the references. Your reply doesn't show > up as a proper followup to my posting. This probably has nothing to do with his mail/news client but rather the mail-news gateway that links python-list and comp.lang.python . -- Robert Ke

Re: Python editor recommendation.

2006-05-09 Thread Jack
PyScripter, a nativen Windows application, free. > > Can any one please recommend me an editor for coding Python. Thank u. > I have Komodo (www.activestate.com) in my mind. Is the editor any good? > > regards. -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expressions, substituting and adding in one step?

2006-05-09 Thread John Salerno
Kent Johnson wrote: > Do it all in one match / substitution using \1 to insert the value of > the paragraph group at the new location: > > In [19]: test = "self.source += '' + paragraph + '\n\n'" > > In [20]: re.sub(r"'' \+ (.*?) \+ '\n\n'", r"'%s\n\n' % > \1", test) > Out[20]: "self.source +=

Re: How to recast integer to a string

2006-05-09 Thread Christoph Haas
On Tue, May 09, 2006 at 12:17:34PM -0700, James wrote: > How to recast an integer to a string? > > something like > n = 5 > str = str + char(n) str(n) Kindly Christoph -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >