Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-15 Thread Raseliarison nirinA
"Harlin Seritt" wrote: > either YES, True, or 1 should work. > yes, indeed. >>> import Tkconstants >>> 'True' and 'YES' in dir(Tkconstants) True thanks Harlin, -- nirinA -- http://mail.python.org/mailman/listinfo/python-list

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bengt Richter) wrote: > On Mon, 14 Mar 2005 23:44:46 -0700, Steven Bethard <[EMAIL PROTECTED]> > wrote: > > >Ron Garret wrote: > >> What I'm really trying to do is to create enumerated types such that if: > >> > >> e1 = enum(lst) and v = e1(x)

Re: How do I pass structures using a C extension?

2005-03-15 Thread Jaime Wyant
I've never built a swig extension module using distutils. Heck, i've only rolled up pure python code using it... that's pretty slick.. Oh, anyway, make sure that libcmdline.h is in swigs search path. Either copy libcmdline.h to $CWD or figure out how to pass -I to swig from distutils: -I

Re: unicode converting

2005-03-15 Thread Maxim Kasimov
Diez B. Roggisch wrote: Maxim Kasimov wrote: there are a few questions i can find answer in manual: 1. how to define which is internal encoding of python unicode strings (UTF-8, UTF-16 ...) It shouldn't be your concern - but you can specify it using " ./configure --enable-unicode=ucs2" or --enab

Re: Why tuple with one item is no tuple

2005-03-15 Thread Gregor Horvath
thanks are given to all "problem" solved... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread El Pitonero
Fernando wrote: > The real problem with Python is ... Python is > going the C++ way: piling feature upon feature, adding bells > and whistles while ignoring or damaging its core design. I totally agree. Look at a recent thread "Compile time evaluation (aka eliminating default argument hacks)" ht

Re: [perl-python] unicode study with unicodedata module

2005-03-15 Thread Brian McCauley
Xah Lee wrote: i don't know what's the state of Perl's unicode. perldoc perlunicode -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp-likeness

2005-03-15 Thread Fernando
On 15 Mar 2005 00:43:49 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: >Maybe You can answer my question what this simple LISP function does ? > >(defun addn (n) > #'(lambda (x) > (+ x n))) The same as def addn(n): def fn(x): return n + x ret

Re: urllib (and urllib2) read all data from page on open()?

2005-03-15 Thread Bengt Richter
On 15 Mar 2005 00:18:10 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: >> On Mon, 14 Mar 2005 14:48:25 -, "Alex Stapleton" ><[EMAIL PROTECTED]> wrote: >> >> >Whilst it might be able to do what I want I feel this to be a flaw >in urllib >> >that should be fixed, or at leas

Re: distutils setup ignoring scripts

2005-03-15 Thread jao
Quoting Raseliarison nirinA <[EMAIL PROTECTED]>: > "Jack Orenstein" wrote: > > > I'm using Python 2.2 on RH9. I have a set of Python modules > > organized > > into a root package and one other package named foobar. setup.py > > looks > > like this: > > > > from distutils.core import setup >

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Steven Bethard
Ron Garret wrote: In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: Ron Garret wrote: What I'm really trying to do is to create enumerated types such that if: e1 = enum(lst) and v = e1(x) then (x in lst) and (e1[v] == x) Use a class with __call__ and __getitem__: py> class

Re: Why tuple with one item is no tuple

2005-03-15 Thread Paddy
Hmm, going 'the other way', you are allowed an extra , but you can't have (,) as the empty tuple.: >>> (1,2,) (1, 2) >>> (1,) (1,) >>> (,) ... Traceback ( File "", line 1 (,) ^ SyntaxError: invalid syntax -- Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread Reinhold Birkenfeld
Jeff Shannon wrote: > Steven Bethard wrote: > >> Jeff Shannon wrote: >> >>> now that almost the entire industry has standardized on power-of-2 >>> word sizes, octal is nearly useless but is still carried about for >>> backwards compatibility. >> >> So do you think it's worth lobbying for its r

Re: How do I pass structures using a C extension?

2005-03-15 Thread [EMAIL PROTECTED]
I'm slowly learning how to use distutils. What I have now is a setup.py and a subdirectory containing the extension I'm playing around with. ## setup.py ## #!/bin/env python import sys, os, glob from distutils.core import setup, Extension py_version='python%d.%d' % (sys.version

Re: Why tuple with one item is no tuple

2005-03-15 Thread James Stroud
On Tuesday 15 March 2005 08:25 am, Roy Smith wrote: > a = ()       # tuple of zero elements > a = (1,)     # tuple of one element > a = 1,       # tuple of one element > a = (1)      # scalar > a = (1, 2)   # tuple of two elements > a = 1, 2     # tuple of two elements > a = ,        # syntax error

Re: Why tuple with one item is no tuple

2005-03-15 Thread Bill Mill
On Tue, 15 Mar 2005 10:47:28 -0800, James Stroud <[EMAIL PROTECTED]> wrote: > On Tuesday 15 March 2005 08:25 am, Roy Smith wrote: > > a = () # tuple of zero elements > > a = (1,) # tuple of one element > > a = 1, # tuple of one element > > a = (1) # scalar > > a = (1, 2) # tu

Re: unicode converting

2005-03-15 Thread TZOTZIOY
On Tue, 15 Mar 2005 18:54:20 +0200, rumours say that Maxim Kasimov <[EMAIL PROTECTED]> might have written: >> It shouldn't be your concern - but you can specify it using " ./configure >> --enable-unicode=ucs2" or --enable-unicode=ucs4. You can't set it to utf-8 >> or utf-16. >is that means that p

Re: Jython Phone Interview Advice

2005-03-15 Thread c d saunter
George Jempty ([EMAIL PROTECTED]) wrote: : I'm undergoing a phone interview for a Jython job today. Anybody have : practical advice for me? I haven't worked with Python in years, but I : have been working with Java in the meantime (resume at : http://scriptify.com/george_jempty_resume.pdf). I've

Re: Lisp-likeness

2005-03-15 Thread Fred Gilham
> (defun addn (n) > (lambda (x) > (+ x n))) > > And Lisp's "macro language" isn't involved at all here. (macroexpand-1 '(lambda (x) (+ x n))) => #'(LAMBDA (X) (+ X N)) Also, #' is a read-macro. Fully expanded the #'(lambda expression would be (function (lambda (x) (+ x n))

readonly class attribute ?

2005-03-15 Thread bruno modulix
Hi How can I make a *class* attribute read-only ? The answer must be pretty obvious but I just can't find it (it's late and I've spent all day on metaclasses, descriptors and the like, which, as fun as it is, may have side-effects on intellectual abilities...) *The context:* # library code class

Re: Why tuple with one item is no tuple

2005-03-15 Thread Reinhold Birkenfeld
Bill Mill wrote: > On Tue, 15 Mar 2005 10:47:28 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >> On Tuesday 15 March 2005 08:25 am, Roy Smith wrote: >> > a = () # tuple of zero elements >> > a = (1,) # tuple of one element >> > a = 1, # tuple of one element >> > a = (1) # scal

c.l.p.announce question

2005-03-15 Thread Fraca7
Hello. It's not quite clear from the chart; I'd like to know if it's kosher to announce the creation of a Python-oriented blog on comp.lang.python.announce ? TIA -- There's no trick to being a humorist when you have the whole government working for you. -- Will Rodgers -- http

Re: c.l.p.announce question

2005-03-15 Thread Bill Mill
On Tue, 15 Mar 2005 22:24:52 +0100, Fraca7 <[EMAIL PROTECTED]> wrote: > Hello. > > It's not quite clear from the chart; I'd like to know if it's kosher to > announce the creation of a Python-oriented blog on > comp.lang.python.announce ? > Well, it's a little late to back out now, isn't it? So c

Re: distutils setup ignoring scripts

2005-03-15 Thread Raseliarison nirinA
yes i'm deadly wrong and should refuse the temptation to guess! and ougth to read clearly the post. > > No, I'm referring to bin/foobar, as specified > in "scripts = ['bin/foobar']". > > Jack so, you want the script foobar included in your package? what command are you issueing? does this inc

Re: c.l.p.announce question

2005-03-15 Thread Fraca7
On Tue, 15 Mar 2005 14:54:18 -0500, Bill Mill wrote: > On Tue, 15 Mar 2005 22:24:52 +0100, Fraca7 <[EMAIL PROTECTED]> wrote: >> Hello. >> It's not quite clear from the chart; I'd like to know if it's kosher to >> announce the creation of a Python-oriented blog on >> comp.lang.python.announce ? >

Re: distutils setup ignoring scripts

2005-03-15 Thread Raseliarison nirinA
Jack wrote: > No, I'm referring to bin/foobar, as specified > in "scripts = ['bin/foobar']". yes i'm deadly wrong and should refuse the temptation to guess! and ougth to read clearly the post. so, you want the script foobar included in your package? what command are you issueing? does this inc

Re: Python becoming less Lisp-like

2005-03-15 Thread James Graves
Brandon J. Van Every <[EMAIL PROTECTED]> wrote: >James Graves wrote: >> >> So with Python 3000, you're going to end up with a language just as >> big as CL, but without the most fundamental building blocks. Ah >> well, to each his own. > >Preventing people from building things from scratch is prob

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Bengt Richter
On Tue, 15 Mar 2005 08:32:51 -0800, Ron Garret <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Bengt Richter) wrote: > >> >Did you mean type(x).__getitem__(x,y)? >> > >> Not if x is a classmethod, D'oh. I meant "not if __getitem__ is a classmethod" ;-P > >Oh yeah,

Re: distutils setup ignoring scripts

2005-03-15 Thread Raseliarison nirinA
"Jack Orenstein" wrote: > No, I'm referring to bin/foobar, as specified > in "scripts = ['bin/foobar']". yes i'm deadly wrong and should refuse the temptation to guess! and ougth to read clearly the post. so, you want the script foobar included in your package? what command are you issueing? d

compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-15 Thread Brandon J. Van Every
James Graves wrote: > > If you want to do application development, Common Lisp is where it's > at, no doubt about it. There are more and better libraries for CL > these days, and they are easier to install and manage with tools like > ASDF. Multiple open-source implementations, covering the most p

Re: readonly class attribute ?

2005-03-15 Thread Simon Percivall
Start the attribute name with "_" and don't document it. If clients mess with it, they're to blame. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-15 Thread "Martin v. Löwis"
Richie Hindle wrote: Yes, that's what's happened. I've copied the new python24.dll into C:\python24, and everything now thinks it's 2.4.1c1. Sorry about that. Is there a reason to keep in c:\python24? Just removing it there should work as well. Regards, Martin -- http://mail.python.org/mailman/li

Universal newline mode with cgi

2005-03-15 Thread oglycans
I know fs = open('file.txt','rU') for universal newlines. In a cgi script, I get files like this: fs = form['file'].file Is there a simple (simple!!! I don't want to do something like write to a local file and then reopen) way to set the mode of fs in this case so it does universal newlines? -

Re: readonly class attribute ?

2005-03-15 Thread Bengt Richter
On Tue, 15 Mar 2005 20:21:19 +0100, bruno modulix <[EMAIL PROTECTED]> wrote: >Hi > >How can I make a *class* attribute read-only ? > >The answer must be pretty obvious but I just can't find it (it's late >and I've spent all day on metaclasses, descriptors and the like, which, >as fun as it is, m

Re: compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-15 Thread Fraca7
On Tue, 15 Mar 2005 12:25:02 -0800, Brandon J. Van Every wrote: > Last I looked, 2 years ago?, there were no compiled, open source lisps that > ran on Windows. Has this changed? I don't think so. I recently (about 2 months ago) started to want to learn Lisp (didn't go far for now) and wanted to

Re: About Databases...

2005-03-15 Thread Peter A.Schott
Have to agree with others here - get a good database backend. MSSQL/Oracle - good choices commercially. Both of these offer good feature sets and have a lot of support from users. However, they are commercial apps and not necessarily free. (You can play with MS SQL Server in the Develope

Re: Python CGI discussion Group

2005-03-15 Thread Dmitry A.Lyakhovets
On 15 Mar 2005 07:05:59 -0800 "Fuzzyman" <[EMAIL PROTECTED]> wrote: > There is a `web design` group over on google-groups. > http://groups-beta.google.com/group/wd > > It's brief is for ``Discussion of web design (html, php, flash, > wysiwig, cgi, perl, python, css, design concepts, etc.).``, but

Re: RotatingFileHandler and logging config file

2005-03-15 Thread Kent Johnson
Rob Cranfill wrote: [BTW, has anyone else noticed that RotatingFileHandler isn't documented in the docs? All the other file handlers have at least a paragraph on their options, but nothing for RFH!] It is in the latest docs. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: compiled open source Windows lisp

2005-03-15 Thread Edi Weitz
On Tue, 15 Mar 2005 23:29:04 +0100, Fraca7 <[EMAIL PROTECTED]> wrote: > I don't think so. I recently (about 2 months ago) started to want to > learn Lisp (didn't go far for now) and wanted to find a Windows > impl, to evaluate "cross-platformability". The only open source/free > software Lisp inte

Re: Convert python to exe

2005-03-15 Thread RM
Does cx_Freeze pack all dependencies? Would te resulting files(s) be able to run on a Linux machine that does not have Python installed? If not, what alternatives are there to accomplish that? Is the McMillan installer still being maintained? Does it work for GUI applications? -Ruben Stephen

Re: compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-15 Thread James Graves
Brandon J. Van Every <[EMAIL PROTECTED]> wrote: >James Graves wrote: >> >> If you want to do application development, Common Lisp is where it's >> at, no doubt about it. There are more and better libraries for CL >> these days, and they are easier to install and manage with tools like >> ASDF. Mul

Re: Boo who? (was Re: newbie question)

2005-03-15 Thread Charles Hixson
Terry Reedy wrote: "Luis M. Gonzalez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... It is as important and "python related" as other projects such as PyPy, Stackless, but I think this is silly. PyPy is an alternate implementation of Python, not a different language.

Re: Convert python to exe

2005-03-15 Thread gene . tani
exemaker and bdist, too: http://effbot.org/downloads/index.cgi/exemaker-1.2-20041012.zip/README http://www.python.org/doc/2.2.3/dist/creating-wininst.html RM wrote: > Does cx_Freeze pack all dependencies? Would te resulting files(s) be > able to run on a Linux machine that does not have Python i

Re: Boo who? (was Re: newbie question)

2005-03-15 Thread Charles Hixson
Grant Edwards wrote: That seems to imply that you think market sucess == technical merits. Unless you mean that Prothon was a technical failure rather than a market-share failure... As Prothon never got as far as an alpha stage product, I don't think you could call it a technical success. It

Re: distutils setup ignoring scripts

2005-03-15 Thread jao
Quoting Raseliarison nirinA <[EMAIL PROTECTED]>: > Jack wrote: > > No, I'm referring to bin/foobar, as specified > > in "scripts = ['bin/foobar']". > > yes i'm deadly wrong and should refuse the > temptation to guess! > and ougth to read clearly the post. > so, you want the script foobar inclu

GUI toolkit question

2005-03-15 Thread eguy
I'm building an app that operates on tuples (typically pairs) of hierarchical structures, and i'd like to add a GUI to display my internal representation of them, and simplify manipulations/operations on them. My requirements are: 1) Draw a single 3D representation of the hierarchies, and the

Re: compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-15 Thread Christopher C. Stacy
"Brandon J. Van Every" <[EMAIL PROTECTED]> writes: > Last I looked, 2 years ago?, there were no compiled, open source > lisps that ran on Windows. Has this changed? GCL (formerly known as KCL and ACL) has been around since 1984, and has been available on Windows since 2000. ECL (another KCL deri

Re: Python becoming less Lisp-like

2005-03-15 Thread Bruno Desthuilliers
Valentino Volonghi aka Dialtone a écrit : Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: It is actually. Ruby's syntax is mostly consistent and coherent, and there is much less special cases than in Python. I'd be glad to know which special cases are you referring to. A few examples: - A stateme

Re: Python becoming less Lisp-like

2005-03-15 Thread Bruno Desthuilliers
Martin Franklin a écrit : Tim Daneliuk wrote: In-Reply-To: <[EMAIL PROTECTED]> (snip) Of course we users will complain about removals, but we'll knuckle down and take our medicine eventually ;-) Except that in this case, removal will also complicate code in some cases. Consider this fragment of Tk

Accessing the contents of a 'cell' object from Python

2005-03-15 Thread paul cannon
Having poked around a little bit, I found there doesn't appear to be any way to get at the contents of a cell object from Python. It's not the sort of thing that one needs to be doing very frequently, but I've run into a few situations recently where it would be really useful from a debugging stand

Re: Python becoming less Lisp-like

2005-03-15 Thread Valentino Volonghi aka Dialtone
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > A few examples: > - A statement is different from an expression (2 special cases instead > of one general case). > - You can't use statements in a lambda Good reason to remove lambda, let's do this asap. > - to get the length of a sequence, you u

Re: readonly class attribute ?

2005-03-15 Thread Bruno Desthuilliers
Simon Percivall a écrit : Start the attribute name with "_" and don't document it. If clients mess with it, they're to blame. The problem is that client code must *define* this attribute when subclassing BaseClass - and that's (well, in most case that should be) the only place where they have to

Re: readonly class attribute ?

2005-03-15 Thread Bruno Desthuilliers
Bengt Richter a écrit : On Tue, 15 Mar 2005 20:21:19 +0100, bruno modulix <[EMAIL PROTECTED]> wrote: Hi How can I make a *class* attribute read-only ? (snip) Does this help, or did I misunderstand? >>> class Base(object): ... class __metaclass__(type): ... def __setattr__(cls, name,

Re: Lisp-likeness

2005-03-15 Thread Thomas A. Russ
Fernando <[EMAIL PROTECTED]> writes: > > On 15 Mar 2005 00:43:49 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> > wrote: > > >Maybe You can answer my question what this simple LISP function does ? > > > >(defun addn (n) > > #'(lambda (x) > > (+ x n))) > > The same as > def addn(n):

Re: Lisp-likeness

2005-03-15 Thread Matthew D Swank
On Tue, 15 Mar 2005 14:16:09 -0800, Thomas A. Russ wrote: > The lisp snippet creates new functions each time the addn function is > called, so one can interleave calls to the individual functions. Yes, I believe them to be equivalent. Each call to addn creates an activation record which is closed

ElementTree/DTD question

2005-03-15 Thread Greg Wilson
I'm trying to convert from minidom to ElementTree for handling XML, and am having trouble with entities in DTDs. My Python script looks like this: -- #!/usr/bin/env python import sys, os from elementtree import ElementTree for

Re: Lisp-likeness

2005-03-15 Thread Valentino Volonghi aka Dialtone
Thomas A. Russ <[EMAIL PROTECTED]> wrote: > > >(defun addn (n) > > > #'(lambda (x) > > > (+ x n))) > > > > The same as > > def addn(n): > > def fn(x): > > return n + x > > return fn > > Is this really equivalent? yes > What happens if you call addn more than on

Re: GUI toolkit question

2005-03-15 Thread gsteff
If you may need to port to another language, you'll probably want to use a toolkit that helps you store the interface description seperately from the code. The example I'm most familiar with is libglade for GTK, although I believe Qt and wx have analagous facilities. I don't do 3D stuff myself, b

why this error?

2005-03-15 Thread spencer
Hi, I'm not sure why I can't concatenate dirname() with basename(). Traceback (most recent call last): File "showDir.py", line 50, in ? print 'somthing new...', os.path.join(os.path.dirname(os.getcwd)) + os.path.basename(os.getcwd()) File "/usr/lib/python2.3/posixpath.py", line 119, in dir

Minidom empty script element bug

2005-03-15 Thread Derek Basch
Hello All, I ran into a problem while dynamically constructing XHTML documents using minidom. If you create a script tag such as: script_node_0 = self.doc.createElement("script") script_node_0.setAttribute("type", "text/javascript") script_node_0.setAttribute("src", "../test.js") minidom renders

Re: urllib (and urllib2) read all data from page on open()?

2005-03-15 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > ISTM reading top-posts is only easier when the top-post is a single global > comment on the quoted text following. And that stops being true as soon as someone wants to comment on that comment. You either wind up with: Last comment > First comment >>

RE: How to create stuffit files on Linux?

2005-03-15 Thread bruce
noah, i'm fairly certain that stuffit will accommodate a number of formats, including zip. if you look around, you probably have open source that will create zip, which can then be read by stuffit... stuffit also provides an sdk that can probably be used to create what you need. check their site,

Re: Lisp-likeness

2005-03-15 Thread Marcin 'Qrczak' Kowalczyk
[EMAIL PROTECTED] (Thomas A. Russ) writes: >> >(defun addn (n) >> > #'(lambda (x) >> > (+ x n))) >> >> The same as >> def addn(n): >> def fn(x): >> return n + x >> return fn > > Is this really equivalent? > > What happens if you call addn more than once with

How to create stuffit files on Linux?

2005-03-15 Thread Noah
I need to create Stuffit (.sit) files on Linux. Does anyone have any ideas for how to do this? I checked the Python docs and on SourceForge, but I didn't see any open source stuffit compatible libraries. Are my Mac users out of luck? Yours, Noah -- http://mail.python.org/mailman/listinfo/python-

Re: Can't seem to insert rows into a MySQL table

2005-03-15 Thread Andy Dustman
Anthra Norell wrote: > Very true! > I could verify that cursor.execute () seems to understand "... %s ...", > ..."string"... where print () doesn't.. I didn't know that. > I could also verify that gumfish's ineffective insertion command works fine > for me. (Python 2.4, mysql-3.23.38). So it looks

Re: why this error?

2005-03-15 Thread F. Petitjean
Le Wed, 16 Mar 2005 17:53:57 -0500, spencer a écrit : > Hi, > I'm not sure why I can't concatenate dirname() with basename(). > > Traceback (most recent call last): > File "showDir.py", line 50, in ? > print 'somthing new...', os.path.join(os.path.dirname(os.getcwd)) + > os.path.basename(os.

Re: why this error?

2005-03-15 Thread Diez B. Roggisch
spencer wrote: > Hi, > I'm not sure why I can't concatenate dirname() with basename(). > > Traceback (most recent call last): > File "showDir.py", line 50, in ? > print 'somthing new...', os.path.join(os.path.dirname(os.getcwd)) + > os.path.basename(os.getcwd()) > File "/usr/lib/python2.3

Re: Minidom empty script element bug

2005-03-15 Thread "Martin v. Löwis"
Derek Basch wrote: XHTML 1.0 specs, Appendix C [EMAIL PROTECTED] C.3 Element Minimization and Empty Element Content Given an empty instance of an element whose content model is not EMPTY (for example, an empty title or paragraph) do not use the minimized form (e.g. use and not ) [EMAIL PROTECTED]

Re: Lisp-likeness

2005-03-15 Thread Roel Schroeven
Thomas A. Russ wrote: > Fernando <[EMAIL PROTECTED]> writes: > > >>On 15 Mar 2005 00:43:49 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> >>wrote: >> >> >>>Maybe You can answer my question what this simple LISP function does ? >>> >>>(defun addn (n) >>> #'(lambda (x) >>> (+ x n))) >>

Re: compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-15 Thread David Golden
James Graves wrote: > > But coverage in this area (compiled CL) is a bit thin, I'll admit. > But who really cares? After all, there are the mature commercial proprietary lisp compilers for those people who insist on using closedware OSes, and they've already proven they're willing to use close

Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
will this be correct??? what i want to happen is saved every received data (6 data bytes) to an array for each one. for k in range (rx_len-9): if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 0xff == 0: #print byte[k:k+10] temp1.append(byte[k+

Re: Lisp-likeness

2005-03-15 Thread Marcin 'Qrczak' Kowalczyk
[EMAIL PROTECTED] (Thomas A. Russ) writes: >> >(defun addn (n) >> > #'(lambda (x) >> > (+ x n))) >> >> The same as >> def addn(n): >> def fn(x): >> return n + x >> return fn > > Is this really equivalent? > > What happens if you call addn more than once with

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread Steven Bethard
Reinhold Birkenfeld wrote: So what's the current state of the "universal-base-prefix" syntax? Something like 10x10, 16xA and 8x12? An interesting thought -- I like the consistency. On the other hand, I have a hard time imagining that this is such a common need that it requires syntactic support.

Re: Python becoming less Lisp-like

2005-03-15 Thread Steven Bethard
Bruno Desthuilliers wrote: class CommandMenuSelectionCallback: def __init__(self, key): self.key = key def __call__(self): print self.key Looks like Java. When was the last time you used Java? It has no support for using classes as callable objects. __call__ would have t

Re: Lisp-likeness

2005-03-15 Thread Pascal Costanza
Marcin 'Qrczak' Kowalczyk wrote: [EMAIL PROTECTED] (Thomas A. Russ) writes: (defun addn (n) #'(lambda (x) (+ x n))) The same as def addn(n): def fn(x): return n + x return fn Is this really equivalent? What happens if you call addn more than once with different paramet

Re: Python becoming less Lisp-like

2005-03-15 Thread Thomas Bellman
Torsten Bronger <[EMAIL PROTECTED]> wrote: > I have exactly the same impression, but for me it's the reason why I > feel uncomfortable with them. For example, I fear that a skilled > package writer could create a module with surprising behaviour by > using the magic of these constructs. If the b

Re: How to create stuffit files on Linux?

2005-03-15 Thread Simon Percivall
Stuffit Expander can handle zip, rar, tar, gz, etc, etc, etc. Don't worry. -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils setup ignoring scripts

2005-03-15 Thread Raseliarison nirinA
"Jack Orenstein" wrote: > Quoting [i]: > > as you use Python22 on RH9, maybe: > > python setup.py bdist_rpm --install-script foobar > > Is install-script really needed? I would have thought that specifying > setup( ... scripts = [...] ...) would suffice, based on the python > docs. > i think you

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread "Martin v. Löwis"
Jeff Shannon wrote: I'd be in favor of that, unless someone can come up with a compelling current use-case for octal literals. Existing code. It may use octal numbers, and it would break if they suddenly changed to decimal. Not only that - breakage would be *silent*, i.e. the computations would j

Re: Accessing the contents of a 'cell' object from Python

2005-03-15 Thread paul cannon
On Tue, Mar 15, 2005 at 03:08:19PM -0700, paul cannon wrote: > Having poked around a little bit, I found there doesn't appear to be any > way to get at the contents of a cell object from Python. It's not the > sort of thing that one needs to be doing very frequently, but I've run > into a few situa

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread Jeff Shannon
Martin v. Löwis wrote: Jeff Shannon wrote: I'd be in favor of that, unless someone can come up with a compelling current use-case for octal literals. Existing code. It may use octal numbers, and it would break if they suddenly changed to decimal. Right, which was my original point -- it was only

Re: Lisp-likeness

2005-03-15 Thread Steven E. Harris
Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> writes: > BTW, the fact that a closure refers to a variable itself rather to its > current value can be used to check the true attitude of languages with > respect to functional programming, by observing how they understand > their basic loops :-) The

Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
ok heres the code, i'm trying on IDLE: import sys import serial import sys, os import serial import string import time from struct import * data_file = open('C:/Documents and Settings/nyer/Desktop/IRRADIANCE.txt', 'r') data = data_file.readlines() def process(list_of_lines): data_points = []

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread Roy Smith
Jeff Shannon <[EMAIL PROTECTED]> wrote: > >> I'd be in favor of that, unless someone can come up with a compelling > >> current use-case for octal literals. I grew up talking octal, and while I'm still more comfortable in octal than hex (newline to me is always going to be 012, not 0xA), even a

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeff Shannon
Martin Franklin wrote: Tim Daneliuk wrote: Except that in this case, removal will also complicate code in some cases. Consider this fragment of Tkinter logic: UI.CmdBtn.menu.add_command(label="MyLabel", command=lambda cmd=cmdkey: CommandMenuSelection(cmd)) In this cas

Re: Python becoming less Lisp-like

2005-03-15 Thread Kent Johnson
Steven Bethard wrote: Bruno Desthuilliers wrote: class CommandMenuSelectionCallback: def __init__(self, key): self.key = key def __call__(self): print self.key Looks like Java. When was the last time you used Java? It has no support for using classes as callable objects.

Re: Accessing the contents of a 'cell' object from Python

2005-03-15 Thread Jeff Epler
Here's an old thread I contributed to which had a similar function (called 'cell_get' in this case) http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/baba3b943524a92c/71b57a32b311ffc8?q=func_closure#71b57a32b311ffc8 http://groups-beta.google.com/group/comp.lang.python/msg/7

Re: why this error?

2005-03-15 Thread Gary Herron
spencer wrote: Hi, I'm not sure why I can't concatenate dirname() with basename(). Of course you *can* concatenate them, but you're not getting that far. The piece os.path.dirname(os.getcwd) should be os.path.dirname(os.getcwd()) Then it will work without raising an exception, but

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeff Shannon
Bruno Desthuilliers wrote: A few examples: [...] - to get the length of a sequence, you use len(seq) instead of seq.len() - to call objects attributes by name, you use [get|set]attr(obj, name [,value]) instead of obj.[get|set]attr(name [,value]) These are both very consistent applications of a mor

Problem with _imaging.pyd in windows

2005-03-15 Thread Vitor Peixeiro
Hello, I install the follow packages python-2.4 for windows PIL-1.1.5c1.win32-py2.4 numarray-1.2.3.win32-py2.4 but when I run some code and this error appear AppName: pythonw.exe AppVer: 0.0.0.0 ModName: _imaging.pyd ModVer: 0.0.0.0 Offset: 373a Exit code: -1073741819 and I don´t know

Re: python reading excel thru ADO ?

2005-03-15 Thread Chris Smith
> "tc" == tc <[EMAIL PROTECTED]> writes: tc> I always used win32com.client to access excel files and parse tc> them, save them as website, csv and so on. tc> why exactly is it that u use ado for solving this? tc> TC The value of ADO would be to throw some Stupid Question La

Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
please post your suggestions? please ... On Wed, 16 Mar 2005 08:33:23 +0800, jrlen balane <[EMAIL PROTECTED]> wrote: > ok heres the code, i'm trying on IDLE: > > import sys > import serial > import sys, os > import serial > import string > import time > from struct import * > > data_file = open

Re: Lisp-likeness

2005-03-15 Thread Carl Banks
Marcin 'Qrczak' Kowalczyk wrote: > [EMAIL PROTECTED] (Thomas A. Russ) writes: > > >> >(defun addn (n) > >> >#'(lambda (x) > >> >(+ x n))) > >> > >> The same as > >> def addn(n): > >>def fn(x): > >>return n + x > >>return fn > > > > Is this really equivalent? > > > >

Re: Lisp-likeness

2005-03-15 Thread Bengt Richter
On Wed, 16 Mar 2005 00:36:40 +0100, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Thomas A. Russ) writes: > >>> >(defun addn (n) >>> > #'(lambda (x) >>> > (+ x n))) >>> >>> The same as >>> def addn(n): >>> def fn(x): >>> return n + x >>>

Re: Python becoming less Lisp-like

2005-03-15 Thread Steven Bethard
Kent Johnson wrote: Steven Bethard wrote: Bruno Desthuilliers wrote: class CommandMenuSelectionCallback: def __init__(self, key): self.key = key def __call__(self): print self.key Looks like Java. When was the last time you used Java? It has no support for using classes a

Re: compiled open source Windows lisp

2005-03-15 Thread Brandon J. Van Every
Christopher C. Stacy wrote: > > All this information has been available in FAQs and > on many web pages since forever. When I Google for "comp.lang.lisp FAQ," I get a document that was last updated in 1997. Consequently I do not pay attention to it. I do peruse newsgroup archives, and I did make

Re: is there a problem on this simple code

2005-03-15 Thread John Machin
jrlen balane wrote: [from further down in the message] > could somebody out there help me. You could try helping yourself. Insert some print statements at salient points. [see examples below; you'll need to get the indentation correct, of course] Try to understand what is happening. > ok heres

Re: Turning String into Numerical Equation

2005-03-15 Thread Giovanni Bajo
Steven Bethard wrote: >>> I use something along these lines: >>> >>> def safe_eval(expr, symbols={}): >>> return eval(expr, dict(__builtins__=None, True=True, >>> False=False), symbols) >>> >>> import math >>> def calc(expr): >>> return safe_eval(expr, vars(math)) >>> >> That offers only n

Re: Python becoming less Lisp-like

2005-03-15 Thread news.sydney.pipenetworks.com
Bruno Desthuilliers wrote: news.sydney.pipenetworks.com a Ãcrit : I looked for a new language for my hobby programming. I used to use Turbo Pascal for 10 years and then C++ for 6 years. A couple of weeks ago, I narrowed my decision to C#, Ruby, and Python. At the moment, I want to go with Pytho

Re: Python becoming less Lisp-like

2005-03-15 Thread news.sydney.pipenetworks.com
Bruno Desthuilliers wrote: Valentino Volonghi aka Dialtone a écrit : Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: It is actually. Ruby's syntax is mostly consistent and coherent, and there is much less special cases than in Python. I'd be glad to know which special cases are you referring to.

<    1   2   3   >