Re: win32 shell extension (virtual drive)

2005-03-15 Thread Tim Roberts
Tiziano Bettio <[EMAIL PROTECTED]> wrote: > >I'm looking for a simple solution of a win32 shell extension (virtual >drive). > >It should make available a new drive with letter, which will be >read-only. Instead of a network drive or similar it then should query a >server application for directory/f

Re: will it cause any problems to open a read-only file & not close it?

2005-03-15 Thread Tim Roberts
Sara Khalatbari <[EMAIL PROTECTED]> wrote: >Dear friends >In a code, I'm opening a file to read. Like : >lines = open(filename).readlines() >& I'm never closing it. >I'm not writing in that file, I just read it. > >Will it cause any problems if you open a file to read >& never close it? A fil

Re: Why tuple with one item is no tuple

2005-03-15 Thread Max M
Gregor Horvath wrote: thanks are given to all "problem" solved... Personally I add a , after every list/tuple item. Also the last. It also makes copy/pasting code easier. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX parsing problem

2005-03-15 Thread David M. Cooke
anon <[EMAIL PROTECTED]> writes: > So I've encountered a strange behavior that I'm hoping someone can fill > me in on. i've written a simple handler that works with one small > exception, when the parser encounters a line with '&' in it, it > only returns the portion that follows the occurence.

Re: code for Computer Language Shootout

2005-03-15 Thread Michael Spencer
Jacob Lee wrote: On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote: string.translate is a good idea. Note you can handle upper-casing and translation in one operation by adding a mapping from lower case to the complement i.e., table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy',

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeremy Bowers
On Tue, 15 Mar 2005 03:21:48 -0800, Paul Boddie wrote: > Well, I've been using Python for almost ten years, and I've managed to > deliberately ignore descriptors and metaclasses quite successfully. I get > the impression that descriptors in particular are a detail of the > low-level implementation

Re: Jython Phone Interview Advice

2005-03-15 Thread Jeremy Bowers
On Tue, 15 Mar 2005 03:21:19 -0800, George Jempty wrote: > I'm noticing that Javascript's array/"hash" literal syntax is EXACTLY the > same as that for Python lists/dictionaries. No it isn't, quite. Two differences of note, one literally syntax and one technically not but you probably still want

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Yeah, except I actually left out one thing: I also want type(v)==e1. > > Why? In Python usually you rely on duck-typing and not explicit type > checks. What is it that you're trying to gain by asserting type(v) ==

Re: code for Computer Language Shootout

2005-03-15 Thread Steven Bethard
Jacob Lee wrote: So here's a tentative contest version of the code: import sys import string def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDM\nKNSYAAWBRTGVHCDMKNSYAAWBR')): seq = seq.translate(table)[::-1] for i in ra

Re: error sending path to Win OS

2005-03-15 Thread Tim Roberts
Earl Eiland <[EMAIL PROTECTED]> wrote: > >A couple of you commented that I should be using os.path.join. >Accordingly, I rewrote my code. Unfortunately, I still have the same >problem. the following code snippet > >Results.SetOriginal(os.path.getsize(os.path.join(InputDirectory , x))) >y = str(x

Re: code for Computer Language Shootout

2005-03-15 Thread Jacob Lee
On Tue, 15 Mar 2005 22:45:48 -0700, Steven Bethard wrote: > # table as default argument value so you don't have to do > # a global lookup each time it's used > > def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVY', > 'TGVHCDM\nKNSYAAWBR') > seq = s

Re: is there a problem on this simple code

2005-03-15 Thread Tim Roberts
jrlen balane <[EMAIL PROTECTED]> wrote: >why is it that here: > >1)rx_data = ser.read(10) >(rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, >pyra2, voltage, current, rx_checksum) = unpack('10B', rx_data) >print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, >pyra2,

Re: code for Computer Language Shootout

2005-03-15 Thread Jacob Lee
On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote: > string.translate is a good idea. Note you can handle upper-casing and > translation in one operation by adding a mapping from lower case to the > complement i.e., > > table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy', >

Re: how to read a tab delimited file

2005-03-15 Thread Steven Bethard
> Peter Hansen wrote: > >>jrlen balane wrote: >> >>>how would i read a tab delimited file? at the same time put what i >>>read in an array, say for example that i know that the file is an >>>array with column= 5 and row=unknown. >> >>Use the "csv" module. Although that stands for "comma >>separate

Re: how to read a tab delimited file

2005-03-15 Thread jrlen balane
if i am going to do this, how should i continue: how would i know the end of file? table_data = open(filename, 'r') table_data.readlines() On Tue, 15 Mar 2005 23:37:50 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > jrlen balane wrote: > > how would i read a tab delimited file? at the same tim

Re: code for Computer Language Shootout

2005-03-15 Thread Steven Bethard
Jacob Lee wrote: There are a bunch of new tests up at shootout.alioth.debian.org for which Python does not yet have code. I've taken a crack at one of them, a task to print the reverse complement of a gene transcription. Since there are a lot of minds on this newsgroup that are much better at optim

Re: code for Computer Language Shootout

2005-03-15 Thread Robert Kern
Here's my solution to the problem[1]: [1] http://shootout.alioth.debian.org/benchmark.php?test=revcomp import sys import string basetable = string.maketrans('ACBDGHKMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDMKNSYAAWBRTGVHCDMKNSYAAWBR') def revcomp(seqlines, linelength=60, base

Re: code for Computer Language Shootout

2005-03-15 Thread Michael Spencer
Jacob Lee wrote: There are a bunch of new tests up at shootout.alioth.debian.org for which Python does not yet have code. I've taken a crack at one of them, a task to print the reverse complement of a gene transcription. Since there are a lot of minds on this newsgroup that are much better at optim

Re: Python becoming less Lisp-like

2005-03-15 Thread Mike C. Fletcher
Thomas Bellman wrote: Torsten Bronger <[EMAIL PROTECTED]> wrote: Just to amplify Thomas' statements... ... And inflexibility will always make some situations horribly daunting to get out of. Powerful constructs like these can, in some cases, enable a skilled package writer to design an API that

Re: Python Debug logging

2005-03-15 Thread Steven Bethard
gf gf wrote: Is there a simple way to log to a debug console in Python? Don't know exactly what you want, but you should check out the logging module: http://docs.python.org/lib/minimal-example.html STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-15 Thread Steven Bethard
Giovanni Bajo wrote: When __builtin__ is not the standard __builtin__, Python is in restricted execution mode. Do you know where this is documented? I looked around, but couldn't find anything. STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: code for Computer Language Shootout

2005-03-15 Thread Robert Kern
Jacob Lee wrote: By the way - is there a good way to find out the maximum memory a program used (in the manner of the "time" command)? Other than downloading and running the shootout benchmark scripts, of course. Inserting appropriate pauses with raw_input() and recording the memory usage using to

Re: Turning String into Numerical Equation

2005-03-15 Thread Michael Spencer
Giovanni Bajo wrote: 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 notional security: >>> ca

code for Computer Language Shootout

2005-03-15 Thread Jacob Lee
There are a bunch of new tests up at shootout.alioth.debian.org for which Python does not yet have code. I've taken a crack at one of them, a task to print the reverse complement of a gene transcription. Since there are a lot of minds on this newsgroup that are much better at optimization than I, I

Re: RotatingFileHandler and logging config file

2005-03-15 Thread Peter Hansen
Rob Cranfill wrote: Kent Johnson wrote: It is in the latest docs. No, it isn't. (But thanks for replying anyway!) Can you prove it isn't? ;-) http://docs.python.org/lib/logging-config-fileformat.html has all the others (OK, maybe not all, I haven't thoroughly checked, but it's got nine of 'em)

Re: how to read a tab delimited file

2005-03-15 Thread Peter Hansen
jrlen balane wrote: how would i read a tab delimited file? at the same time put what i read in an array, say for example that i know that the file is an array with column= 5 and row=unknown. Use the "csv" module. Although that stands for "comma separated values", it readily supports alternative de

SAX parsing problem

2005-03-15 Thread anon
So I've encountered a strange behavior that I'm hoping someone can fill me in on. i've written a simple handler that works with one small exception, when the parser encounters a line with '&' in it, it only returns the portion that follows the occurence. For example, parsing a file with the lin

how to read a tab delimited file

2005-03-15 Thread jrlen balane
how would i read a tab delimited file? at the same time put what i read in an array, say for example that i know that the file is an array with column= 5 and row=unknown. -- http://mail.python.org/mailman/listinfo/python-list

Re: RotatingFileHandler and logging config file

2005-03-15 Thread Rob Cranfill
Kent Johnson wrote: It is in the latest docs. Kent No, it isn't. (But thanks for replying anyway!) http://docs.python.org/lib/logging-config-fileformat.html has all the others (OK, maybe not all, I haven't thoroughly checked, but it's got nine of 'em) but nothing for RFH. Or is that not "the la

Re: unicode converting

2005-03-15 Thread Leif K-Brooks
Maxim Kasimov wrote: 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-uni

Re: Python becoming less Lisp-like

2005-03-15 Thread news.sydney.pipenetworks.com
Torsten Bronger wrote: HallÃchen! [EMAIL PROTECTED] (Paul Boddie) writes: Torsten Bronger <[EMAIL PROTECTED]> wrote: At first, I was very pleased by Python's syntax (and still I am). Then, after two weeks, I learned about descriptors and metaclasses and such and understood nothing (for the first

Re: Python Debug logging

2005-03-15 Thread news.sydney.pipenetworks.com
gf gf wrote: Is there a simple way to log to a debug console in Python? In .NET, you can Debug.Write(str), which does nothing if there is no debug console open, but, if there is, debugs the message. Is there something similar? Alternatively, is there a very simple log4j type setup? I emphasize ve

Python Debug logging

2005-03-15 Thread gf gf
Is there a simple way to log to a debug console in Python? In .NET, you can Debug.Write(str), which does nothing if there is no debug console open, but, if there is, debugs the message. Is there something similar? Alternatively, is there a very simple log4j type setup? I emphasize very simple,

Re: Dumping an instance

2005-03-15 Thread Peter Hansen
gf gf wrote: If I want to dump (for debugging) an instance and all of it's member attributes, what's the simplest way? print myInstance just gives a pointer to its location in memory Roughly speaking, as a starting point: from pprint import pformat def dump(obj): print repr(obj) for name in

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

2005-03-15 Thread Yevgen Muntyan
Jaime Wyant wrote: > You need to check out swig. It is the *only* way to setup a `c' > library for use with python. It's not. Regards, Yevgen -- http://mail.python.org/mailman/listinfo/python-list

Re: Dumping an instance

2005-03-15 Thread Roy Smith
In article <[EMAIL PROTECTED]>, gf gf <[EMAIL PROTECTED]> wrote: > If I want to dump (for debugging) an instance and all > of it's member attributes, what's the simplest way? > > print myInstance > > just gives a pointer to its location in memory You need to write a str() method for the class.

Dumping an instance

2005-03-15 Thread gf gf
If I want to dump (for debugging) an instance and all of it's member attributes, what's the simplest way? print myInstance just gives a pointer to its location in memory Thanks! __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Ma

Re: Minidom empty script element bug

2005-03-15 Thread Derek Basch
Martin v. Löwis wrote: > 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 mini

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   3   >