Python Users Nederland - python-nl mailing list

2004-12-22 Thread Johannes Gijsbers
Python Users Nederland, PUN, houdt haar tweede meeting op dinsdag 11 januari om 20.00. Agenda We beginnen om 20.00 met een presentatie van 1-1,5 van Martijn Faassen. Hij zal spreken over de Zope 3 component architectuur, met misschien een aantal uitweidingen over Five (Zope 3 in Zope

Snurf 0.2.1 - A Python-based Blogging System

2004-12-22 Thread Mark Rowe
I am pleased to announce `Snurf 0.2.1`_, a bug-fix release for the Snurf blogging system. .. _Snurf 0.2.1: http://snurf.bdash.net.nz/2004/12/22/snurf-0-2-1-available/ What is Snurf? --- Snurf is a Python-based blogging system that differs from many similar systems in that it uses

[ANNOUNCE] Twentieth release of PythonCAD now available

2004-12-22 Thread Art Haas
Hi. I'm pleased to announce the twentieth development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually exceed

Re: word to digit module

2004-12-22 Thread Fredrik Lundh
Stephen Thorne wrote: Is there any module available that converts word like 'one', 'two', 'three' to corresponding digits 1, 2, 3?? This seemed like an interesting problem! So I decided to solve it. for i in range(4): that's a slightly unusual definition of digit, but it's a nice

Re: Python To Send Emails Via Outlook Express

2004-12-22 Thread ian
Hi Lenard, Absolutely fantastic!! That worked like a charm. Now onto adapting it to send attachments. Thanks again Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are tuples immutable?

2004-12-22 Thread Antoon Pardon
Op 2004-12-21, Jeff Shannon schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2004-12-21, Nick Coghlan schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Why then doesn't python think the same about sorted lists. When I have a sorted list and do operations on it that depend on it being

Re: Why are tuples immutable?

2004-12-22 Thread Antoon Pardon
Op 2004-12-21, Fredrik Lundh schreef [EMAIL PROTECTED]: Jeff Shannon wrote: So show us a dictionary (i.e. hash table) implementation that can do this. You'll need to be able to derive the old hash from the new hash, of course, so that you can correctly associate the values already

Re: Why are tuples immutable?

2004-12-22 Thread Fredrik Lundh
Antoon Pardon wrote: and to temporarily refer back to the top of this thread, do all this without any performance impact, compared to the current implementation. Why should that be? This originated when someone argued that lists could easily be resorted and reheapified. from the original

Re: Why are tuples immutable?

2004-12-22 Thread Antoon Pardon
Op 2004-12-21, Jeff Shannon schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2004-12-17, Jeff Shannon schreef [EMAIL PROTECTED]: Now, even if hash were made to equal id... suppose I then pass that dict to a function, and I want to get the value that I've stored under [1,2]. In order to

Re: Why are tuples immutable?

2004-12-22 Thread Bengt Richter
On 21 Dec 2004 10:37:20 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: Op 2004-12-18, Bengt Richter schreef [EMAIL PROTECTED]: As it turns out, python makes no difference in difficulty for making either mutable or immutable objects usable as dictionary keys. The only difference is that python only

Re: Why are tuples immutable?

2004-12-22 Thread Antoon Pardon
Op 2004-12-22, Fredrik Lundh schreef [EMAIL PROTECTED]: Antoon Pardon wrote: and to temporarily refer back to the top of this thread, do all this without any performance impact, compared to the current implementation. Why should that be? This originated when someone argued that lists could

Garbage collector strategy

2004-12-22 Thread Martin Drautzburg
Just for curiosity: does python use a mark-and-sweep garbage collector or simple reference counting? In the latter case it would not garbage collect circular references, right ? For mark-and-sweep, I assume there must be a toplevel Object from which all other objects can be accessed or they will

Re: how to start a new process while the other ist running on

2004-12-22 Thread Erik Geiger
Fredrik Lundh schrieb: Erik Geiger wrote: [...] How to start a shell script without waiting for the exit of that shell script? It shall start the shell script and immediately execute the next python command. if you have Python 2.4, you can use the subprocess module:

Re: how to start a new process while the other ist running on

2004-12-22 Thread Erik Geiger
Jean Brouwers schrieb: See the os. spawn* functions. For example os.spawnv(os.P_NOWAIT, /path/to/script, args) /Jean Brouwers Thats what I've tried, but failed. Thanks anyway ;-) Greets Erik [...] -- Jemanden wie ein rohes Ei zu behandeln kann auch bedeuten, ihn in die

['ext.IsDOMString', 'ext.SplitQName']

2004-12-22 Thread Jindal, Pankaj
Hi, I am new to Python-XML programming. I am using python 2.3.4, py2exe 0.5.3, pyXML 0.8.4. While making executable by py2exe I am getting folowing warning:- The following modules appear to be missing ['ext.IsDOMString', 'ext.SplitQName'] Even after trying the option:- setup.py py2exe --includes

Re: embedding: forcing an interpreter to end

2004-12-22 Thread Miki Tebeka
Hello pdectm, You have a Python port to uClinux? Nope, not yet. That would have been my next post :-) I thought there would have been much more work on cross-compiling and porting Python. The problem is with Python's build proces, it 1'st created pgen and then use it for the next stage.

Re: Garbage collector strategy

2004-12-22 Thread Stephen Kellett
In message [EMAIL PROTECTED], Martin Drautzburg [EMAIL PROTECTED] writes Just for curiosity: does python use a mark-and-sweep garbage collector or simple reference counting? In the latter case it would not garbage collect circular references, right ? gcmodule.c in the python sources shows the

Re: Garbage collector strategy

2004-12-22 Thread Fredrik Lundh
Martin Drautzburg wrote: Just for curiosity: does python use a mark-and-sweep garbage collector or simple reference counting? python the language doesn't specify this, but I assume you meant the CPython interpreter. both, sort of: it uses reference counting, and a separate cycle breaking

Re: Why are tuples immutable?

2004-12-22 Thread Antoon Pardon
Op 2004-12-22, Bengt Richter schreef [EMAIL PROTECTED]: On 21 Dec 2004 10:37:20 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: Op 2004-12-18, Bengt Richter schreef [EMAIL PROTECTED]: As it turns out, python makes no difference in difficulty for making either mutable or immutable objects usable as

Re: Why are tuples immutable?

2004-12-22 Thread Antoon Pardon
Op 2004-12-22, Fredrik Lundh schreef [EMAIL PROTECTED]: Antoon Pardon wrote: But this was another subthread. oh, sorry, I was under the flawed assumption that the first few posts to a thread should be seen in the context of the original post. So? In the mean time there have been more than

Re: Python To Send Emails Via Outlook Express

2004-12-22 Thread ian
Hi Lenard, Absolutely fantastic!! That worked like a charm. Now onto adapting it to send attachments. Thanks again Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpclib question

2004-12-22 Thread writeson
Thanks for the responses, you were both on the right track, I just didn't provide enough of the right information. I solved the problem by changing localhost in the server code to actually contain the name of the machine, the same as it appears in our DNS. This enabled the client to connect to the

Re: Threading Problem

2004-12-22 Thread Steve Holden
Norbert wrote: Hello *, i am experimenting with threads and get puzzling results. Consider the following example: # import threading, time def threadfunction(): .print threadfunction: entered .x = 10 .while x 40: .time.sleep(1) # time unit is seconds

Re: word to digit module

2004-12-22 Thread John Machin
Stephen Thorne wrote: On Wed, 22 Dec 2004 10:27:16 +0530, Gurpreet Sachdeva [EMAIL PROTECTED] wrote: Is there any module available that converts word like 'one', 'two', 'three' to corresponding digits 1, 2, 3?? This seemed like an interesting problem! So I decided to solve it. I started

Mutable objects which define __hash__ (was Re: Why are tuples immutable?)

2004-12-22 Thread Nick Coghlan
OK, I think I need to recap a bit before starting my reply (for my own benefit, even if nobody else's). (The rest of this post will also include a fair bit of repeating things that have already been said elsewhere in the thread) The actual rule dictionaries use when deciding whether or not

Re: Threading Problem

2004-12-22 Thread Alan Kennedy
[Norbert] i am experimenting with threads and get puzzling results. Consider the following example: # import threading, time def threadfunction(): print threadfunction: entered x = 10 while x 40: time.sleep(1) # time unit is seconds print

Re: Lazy argument evaluation (was Re: expression form of one-to-many dict?)

2004-12-22 Thread Nick Coghlan
Nick Coghlan wrote: def lazycall(x, *args, **kwds): Executes x(*args, **kwds)() when called return lambda : x(*args, **kwds)() It occurred to me that this should be: def lazycall(x, *args, **kwds): Executes x()(*args, **kwds) when called return lambda : x()(*args, **kwds) (Notice where

Re: Threading Problem

2004-12-22 Thread Norbert
Thanks a lot, Steve, for your fast reply. But the behaviour is the same if 'threadfunction' sleeps longer than just 1 second. 'threadfunction' is of course a dummy to show the problem, imagine a longrunning background-task. If you are right, the question remains 'How can I assure that the

Re: When was extended call syntax introduced?

2004-12-22 Thread Edward K. Ream
That was in Python 2.0, see Thanks very much, Martin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading Problem

2004-12-22 Thread Norbert
Thanks Alan, i hoped it would be something trivial :) Norbert -- http://mail.python.org/mailman/listinfo/python-list

Re: Lazy argument evaluation (was Re: expression form of one-to-many dict?)

2004-12-22 Thread Nick Coghlan
Steven Bethard wrote: There must be something wrong with this idea that I'm missing. . . Well, it does cost you some conciceness, as your examples show[1]: lazy(mul, x, y) v.s. :x * y lazy(itemgetter(i), x) v.s. :x[i] lazy(attrgetter(a), x)v.s.

Re: Mutable objects which define __hash__ (was Re: Why are tuplesimmutable?)

2004-12-22 Thread Fredrik Lundh
Nick Coghlan wrote: I have a different suggestion: an identity dictionary. It ignores __hash__, __cmp__ and __eq__, and instead uses id() and is. that's a rather common pattern, and you don't really need a special type to handle it: just replace d[k] with d[id(k)]. if you really need to

Re: how to pass globals across modules (wxPython)

2004-12-22 Thread Jorge Luiz Godoy Filho
Fredrik Lundh, Tera 21 Dezembro 2004 16:33, wrote: well, in my applications, subsystems usually consists of one or more classes, or at least one or more functions. code that needs the global context usually gets the content either as a constructor argument, or as an argument to individual

Re: Threading Problem

2004-12-22 Thread Fredrik Lundh
Steve Holden wrote: Well, I don't believe there's any guarantee that a thread will get run preference over its starter - they're both threads, after all. Try putting a sleep after th.start() and before the print statement and you should see that the worker thread runs while the main

Re: A rational proposal

2004-12-22 Thread Nick Coghlan
Mike Meyer wrote: Well, you want to be able to add floats to rationals. The results shouldn't be rational, for much the same reason as you don't want to convert floats to rationals directly. I figure the only choice that leaves is that the result be a float. That and float(rational) should be the

Re: input record sepArator (equivalent of $| of perl)

2004-12-22 Thread Nick Coghlan
John Machin wrote: Nick Coghlan wrote: [snip] delimeter. Hey, Terry, another varmint over here! Heh. Just don't get me started on the issues I have with typing apostrophes in the right spot. My *brain* knows where they go, but for some reason it refuses to let my fingers in on the secret. . .

mathmatical expressions evaluation

2004-12-22 Thread Tonino
Hi, I have a task of evaluating a complex series (sorta) of mathematical expressions and getting an answer ... I have looked at the numarray (not really suited??) and pythonica (too simple??) and even tried using eval() ... but wondered if there were other packages/modules that would enable me

Metaclasses

2004-12-22 Thread Bob . Cowdery
Title: Message Hi I am trying to build a capability based API. That is, an instance of the api will reflect the capabilities of some underlying services. I could have several different instances of the api concurrently running against different back end services. A ui applet will bind to

Re: Is this a good use for lambda

2004-12-22 Thread Nick Coghlan
Jeff Shannon wrote: Er, not as far as I can tell the 2.4 feature was what wouldn't work consistently; the corrected version, using list() and reverse(), doesn't look like it has anything that'll be a problem in my 2.2 installation, and probably not in 2.1 What he said :) Although if

Re: How to find unused methods

2004-12-22 Thread TZOTZIOY
On 22 Dec 2004 10:27:58 +0100, rumours say that Martin Drautzburg [EMAIL PROTECTED] might have written: Is there an elegant way for finding unsent methods as in Smalltalk ? I am aware of the fact that due to pythons dynamic typing, no tool in the world can find ALL unsent methods (same in

Re: Best GUI for small-scale accounting app?

2004-12-22 Thread kdahlhaus
ZOPE could provide the workaround but ZOPE seems really huge to me and an overkill for this. Or maybe it would work? I am intenionally *not* trying to argue web vs traditional gui for your app, but to tuck away for future apps, CherryPy2 is a lot easier than Zope to use and programming it does

Kamaelia Released

2004-12-22 Thread Michael Sparks
Hi, I've already posted an announcement in comp.lang.python.announce about this, but for those who were at Europython and remember me giving a lightning talk on Kamaelia who don't read c.l.p.a - this is just a quick note to say that we've been given the go ahead to release it as open source and

Re: mathmatical expressions evaluation

2004-12-22 Thread beliavsky
There is QuantLib at http://quantlib.org/ . The site says QuantLib is written in C++ with a clean object model, and is then exported to different languages such as Python, Ruby, and Scheme. I have not tried it -- if it is easily usable from Python please write back to c.l.p. There is a Python

Newbie namespace question

2004-12-22 Thread [EMAIL PROTECTED]
I have a variable that I want to make global across all modules, i.e. I want it added to the builtin namespace. Is there a way to do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie namespace question

2004-12-22 Thread deelan
[EMAIL PROTECTED] wrote: I have a variable that I want to make global across all modules, i.e. I want it added to the builtin namespace. Is there a way to do this? i would not pollute built-ins namespace. how about: ### a.py FOO = I'm a global foo! ### b.py import a print a.FOO HTH, deelan --

Re: Newbie namespace question

2004-12-22 Thread Steve Holden
[EMAIL PROTECTED] wrote: I have a variable that I want to make global across all modules, i.e. I want it added to the builtin namespace. Is there a way to do this? Of course: you can do *anything* in Python. I'm not sure this is to be recommended, but since you ask ... if you have # mymod.py

Re: embedding: forcing an interpreter to end

2004-12-22 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Well, the app is multi-threaded, so I do have a big issue getting control back to my C program. I just can not seem to cleanly stop the interpreter. The best I could do is: void terminateInterpreter( PyInterpreterState *interp ) [...]

Re: regular expression: perl == python

2004-12-22 Thread Doug Holton
Fredrik Lundh wrote: JZ [EMAIL PROTECTED] wrote: import re line = The food is under the bar in the barn. if re.search(r'foo(.*)bar',line): print 'got %s\n' % _.group(1) Traceback (most recent call last): File jz.py, line 4, in ? print 'got %s\n' % _.group(1) NameError: name '_' is not

Re: Printing

2004-12-22 Thread Peter Hansen
Craig Ringer wrote: I don't have a windows box to test with - well, our NT4 server, but it doesn't have anything on the serial ports. I would think that one just: printerport = open(lpt1,w) but on my NT box that results in a file not found exception. lpt0 opens, but I have no idea if it works. I

Ack! Zombie processes won't die!

2004-12-22 Thread Brian
From one script, I'm spawnv'ing another that will launch mpg123 to play a specified mp3. Problem is that After the second script has launched mpg123, it'll turn into a zombie process. It doesn't happen when I launch it from the command line, so there's something wrong with the way I'm

Re: regular expression: perl == python

2004-12-22 Thread JZ
Dnia Wed, 22 Dec 2004 10:27:39 +0100, Fredrik Lundh napisa(a): import re line = The food is under the bar in the barn. if re.search(r'foo(.*)bar',line): print 'got %s\n' % _.group(1) Traceback (most recent call last): File jz.py, line 4, in ? print 'got %s\n' % _.group(1)

Re: Ack! Zombie processes won't die!

2004-12-22 Thread Jp Calderone
On Wed, 22 Dec 2004 15:37:18 GMT, Brian [EMAIL PROTECTED] wrote: From one script, I'm spawnv'ing another that will launch mpg123 to play a specified mp3. Problem is that After the second script has launched mpg123, it'll turn into a zombie process. It doesn't happen when I launch it from

Re: regular expression: perl == python

2004-12-22 Thread Jp Calderone
On Wed, 22 Dec 2004 16:44:46 +0100, JZ [EMAIL PROTECTED] wrote: Dnia Wed, 22 Dec 2004 10:27:39 +0100, Fredrik Lundh napisaƂ(a): import re line = The food is under the bar in the barn. if re.search(r'foo(.*)bar',line): print 'got %s\n' % _.group(1) Traceback (most recent call

Re: regular expression: perl == python

2004-12-22 Thread Fredrik Lundh
JZ wrote: import re line = The food is under the bar in the barn. if re.search(r'foo(.*)bar',line): print 'got %s\n' % _.group(1) Traceback (most recent call last): File jz.py, line 4, in ? print 'got %s\n' % _.group(1) NameError: name '_' is not defined I forgot to

Re: mod_python and xml.sax

2004-12-22 Thread Jeffrey Froman
Fredrik Lundh wrote: iirc, both apache and python uses the expat parser; if you don't make sure that both use the same expat version, you may get into trouble. Thank you very much Fredrik, this does seem to be the problem I was having. this poster claims to have a fix:

Re: PyCon is coming - we need your help

2004-12-22 Thread Aahz
In article [EMAIL PROTECTED], jfj [EMAIL PROTECTED] wrote: I wish it was in Amsterdam.. ;) Feel free to run one there! Then again, there's already EuroPython. -- Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/ 19. A language that doesn't affect the way you think

Re: newbie question

2004-12-22 Thread Doug Holton
Stephen Waterbury wrote: Luis M. Gonzalez wrote: Amyway, I wouldn't want to use this list to talk about Boo, because I think that the best place to do it is comp.lang.boo. However, since I think it is definetely python related (I know you disagree, but others don't) I see no harm in mentioning it

Re: File locking is impossible in Windows?

2004-12-22 Thread elbertlev
I just have written the program in C, which does the same. It behaves almost the way you described. Tthe copy command gives such diagnostic: The process cannot access the file because another process has locked a portion of the file. 0 file(s) copied. BUT THE FILE IS ACTUALLY OVERWRITTEN.. I'm

Re: Newbie namespace question

2004-12-22 Thread deelan
[EMAIL PROTECTED] wrote: (...) Run it and get a name error, which, makes sense. If I try to use the standard import solution as deelan suggests I have a circular reference on the imports and I get an error that it can't import class DataSource (presumbably because it hasn't gotten far enough

MIDI (was - Re: BASIC vs Python)

2004-12-22 Thread Bob van der Poel
Jan Dries wrote: Andrew Dalke wrote: Jan Dries If you just want to play notes, you could look at MIDI. [snip] It's hard to compare that to the current era. Sound clips are much more common, it's easy to record audio, keyboards and other specialized devices are cheap, and there's plenty of mixer

Re: Step by step: Compiling extensions with MS Visual C++ Toolkit 2003 - msvccompiler-patch.txt (0/1)

2004-12-22 Thread wjb131
... d:\Python24\include\pyconfig.h(30) : fatal error C1083: Cannot open include file : 'io.h': No such file or directory error: command 'D:\Programme\Microsoft Visual C++ Toolkit 2003\bin\cl.exe' fai led with exit status 2 why? Under : HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio

Re: trouble building python2.4

2004-12-22 Thread Erik Max Francis
Matthew Thorley wrote: Greetings, I just downloaded the python2.4 source from python.org and built it the usual way, i.e. ./configure make. What I don't understand is that the resulting binary, when run, prints this line Python 2.3.4 (#1, Nov 15 2004, 10:29:48) at the top of its banner.

Re: trouble building python2.4

2004-12-22 Thread Matthew Thorley
Erik Max Francis wrote: Matthew Thorley wrote: Greetings, I just downloaded the python2.4 source from python.org and built it the usual way, i.e. ./configure make. What I don't understand is that the resulting binary, when run, prints this line Python 2.3.4 (#1, Nov 15 2004, 10:29:48) at the

Re: [Re: newbie question]

2004-12-22 Thread Ed Leafe
On Dec 22, 2004, at 11:38 AM, Reinhold Birkenfeld wrote: Apart from that it is considered disrespectful to put your opponent's name into the subject, this flame war is biting its tail already. You've missed the obvious: it's 'criticism' or 'observation' when it comes from Doug, but it's a

Re: newbie question

2004-12-22 Thread Richie Hindle
[Doug] I'm only halfway through his message. It would take me all day to point out all [Peter Hansen's] flames. Doug, this is not worth your time. It certainly isn't worth mine, nor that of the other thousands of people who are being subjected to this argument. Please, consider putting

Re: [Re: newbie question]

2004-12-22 Thread Steve Holden
Doug Holton wrote: Reinhold Birkenfeld wrote: Doug Holton wrote: Peter Hansen wrote: As a result of all the activity in the Boo who? thread, however, that you started Apart from that it is considered disrespectful to put your opponent's name into the subject, this flame war is biting its tail

RE: Metaclasses

2004-12-22 Thread Robert Brewer
Bob Cowdery wrote: I am trying to build a capability based API. That is, an instance of the api will reflect the capabilities of some underlying services. I could have several different instances of the api concurrently running against different back end services. A ui applet will bind to

Re: [Re: newbie question]

2004-12-22 Thread Doug Holton
Steve Holden wrote: 'Scuse me? This group has a long history of off-topic posting, and anyway who decided that CPython should be the exclusive focus? Even on-topic we can talk about Jython and PyPy as well as CPython. Off-topic we can talk about what we damned well please. Even boo :-)

Re: trouble building python2.4

2004-12-22 Thread Steve Holden
Matthew Thorley wrote: I have got to be the stupidest person on the face of the planet. I'll have you know I don't welcome newcomers to this newsgroup trying to steal my hard-won reputation, if you don't mind. keeping-it-light-ly y'rs - steve -- Steve Holden

Re: win32 process name

2004-12-22 Thread Keith Dart
Fredrik Lundh wrote: phil [EMAIL PROTECTED] wrote: from win32all EnumProcesses gives me the pids, then OpenProcess(pid) gives me a handle. Then what? GetModuleFileNameEX? It requires two handles as args and I can't figure out which one is the handle from OpenProcess and what it wants for the

extract news article from web

2004-12-22 Thread Zhang Le
Hello, I'm writing a little Tkinter application to retrieve news from various news websites such as http://news.bbc.co.uk/, and display them in a TK listbox. All I want are news title and url information. Since each news site has a different layout, I think I need some template-based techniques to

Re: File locking is impossible in Windows? SOLUTION

2004-12-22 Thread Pekka Niiranen
Hi everybody: I played with the class Flock and changed the line win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE,\ to win32con.FILE_SHARE_READ,\ and now I cannot copy the file over which suits me. When file is NOT locked I get: E:\copy d:\log.txt . Overwrite .\log.txt? (Yes/No/All): y 1

Re: regular expression: perl == python

2004-12-22 Thread Nick Craig-Wood
1) In perl: $line = The food is under the bar in the barn.; if ( $line =~ /foo(.*)bar/ ) { print got $1\n; } in python, I don't know how I can do this? How does one capture the $1? (I know it is \1 but it is still not clear how I can simply print it. thanks Fredrik Lundh [EMAIL

Your message to plucker-dev awaits moderator approval

2004-12-22 Thread plucker-dev-admin
Your mail to 'plucker-dev' with the subject Delivery ([EMAIL PROTECTED]) Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive

Re: Why are tuples immutable?

2004-12-22 Thread Jeff Shannon
Antoon Pardon wrote: Op 2004-12-21, Jeff Shannon schreef [EMAIL PROTECTED]: Antoon Pardon wrote: So show us a dictionary (i.e. hash table) implementation that can do this. Why should I, Do you doubt that it is possible? Yes. You'll need to be able to derive the old hash from the

wxPython help

2004-12-22 Thread km
Hi all, i am trying out some of the demo programs in wxPython. but i am getting an error: no module 'run' how do i circumvent this module and run the program with main.Loop() ? tia, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are tuples immutable?

2004-12-22 Thread Steven Bethard
Antoon Pardon wrote: Well the only suggestion I would make now is that it would be nice to have a second dict type that would make a copy of a key and insert that copy in the dictionary. (At least) two options here, depending on what you really need. (1) Use current dicts. They will still give

Re: how to start a new process while the other ist running on

2004-12-22 Thread Donn Cave
In article [EMAIL PROTECTED], Erik Geiger [EMAIL PROTECTED] wrote: Fredrik Lundh schrieb: Erik Geiger wrote: [...] How to start a shell script without waiting for the exit of that shell script? It shall start the shell script and immediately execute the next python command. if

Re: Why are tuples immutable?

2004-12-22 Thread Jeff Shannon
Antoon Pardon wrote: Op 2004-12-21, Jeff Shannon schreef [EMAIL PROTECTED]: How does the dict know which value is associated with which key? Because there is a link between the key and the value. The problem with a mutated key in a dictionary is not that the link between the key and the

Re: Mutable objects which define __hash__ (was Re: Why are tuples immutable?)

2004-12-22 Thread Steven Bethard
Nick Coghlan wrote: The longer I consider it, the more this seems like a valid analogy. There is nothing preventing dictionaries from having a rehash() method. Consider: # Mutate some value in mylist mylist.sort() # Mutate some key in mydict mydict.rehash() Well, you can already get the

Re: trouble building python2.4

2004-12-22 Thread Tim Peters
[Matthew Thorley] I have got to be the stupidest person on the face of the planet. [Steve Holden] I'll have you know I don't welcome newcomers to this newsgroup trying to steal my hard-won reputation, if you don't mind. In all fairness, Matthew did present evidence to support his claim. For

Source cross reference + colourizer (PyXR is no more?)

2004-12-22 Thread Roger Binns
I have been a happy user of PyXR which colourizes source to HTML and also cross references it. Here is an example of the output: http://bitpim.org/pyxr/c/projects/bitpim/analyser.py.html Unfortunately the author and his site appears to have gone AWOL for quite a while. It used to be:

Re: Mutable objects which define __hash__ (was Re: Why are tuples immutable?)

2004-12-22 Thread Jeff Shannon
Nick Coghlan wrote: I have a different suggestion: an identity dictionary. It ignores __hash__, __cmp__ and __eq__, and instead uses id() and is. This might be useful in some special cases, though it's pretty easy to use a standard dict and explicitly use object ids as keys ( d[id(myobj)] = ...

Re: How about pure virtual methods?

2004-12-22 Thread Jeff Shannon
Fredrik Lundh wrote: Noam Raphael wrote: Oh, and another thing - maybe abstract is a better name than notimplemented? notimplemented might suggest a method which doesn't have to be implemented - and raises NotImplementedError when it is called. What do you think? what's the difference?

Re: Python To Send Emails Via Outlook Express

2004-12-22 Thread Lenard Lindstrom
[EMAIL PROTECTED] writes: Hi Lenard, Absolutely fantastic!! That worked like a charm. Now onto adapting it to send attachments. Glad to be of help. Lenard Lindstrom -- http://mail.python.org/mailman/listinfo/python-list

Re: File locking is impossible in Windows? SOLUTION

2004-12-22 Thread elbertlev
Sure it will do if one of the processes needs read access only. Scenario when you need shared rw acces with locking: In the file you have records say 30 bytes long, 2 processes are reading/writing these records by: lock-read-unlock or lock-write-unlock . Both processes have to open the file with

Re: error problems for import some copora with nltk

2004-12-22 Thread [EMAIL PROTECTED]
Dear Tony.Meyer, Thank you for answering this. I did exactly what you told me, but I got following messages. Do you have any idea? = import nltk from nltk.corpus import gutenberg Traceback (most recent call last):

Re: Newbie namespace question

2004-12-22 Thread Jeff Shannon
[EMAIL PROTECTED] wrote: Now, in jdbc.py I have #jdbc.py class DataSource: def __init__(self, servername): self.servername = servername def create(name, connectionInfo, etc): #Call the IBM supplied WebSphere config object AdminConfig.create('DataSource') Run it and get a name error, which, makes

Jython performance

2004-12-22 Thread Gabriel Cosentino de Barros
Title: Jython performance On the Best GUI for small-scale accounting app? tread some people mentioned jython. I went to read about it, but i was wondering if anyone has any real project done with it and can give real world comments about performance. Thanks, Gabriel --

Re: regular expression: perl == python

2004-12-22 Thread Fredrik Lundh
Nick Craig-Wood wrote: I've found that a slight irritation in python compared to perl - the fact that you need to create a match object (rather than relying on the silver thread of $_ (etc) running through your program ;-) the old regex engine associated the match with the pattern, but that

Re: error problems for import some copora with nltk

2004-12-22 Thread Jeff Shannon
[EMAIL PROTECTED] wrote: Dear Tony.Meyer, Thank you for answering this. I did exactly what you told me, but I got following messages. Do you have any idea? = import nltk from nltk.corpus import gutenberg

Re: Jython performance

2004-12-22 Thread Sean Blakey
On Wed, 22 Dec 2004 17:03:55 -0200, Gabriel Cosentino de Barros [EMAIL PROTECTED] wrote: On the Best GUI for small-scale accounting app? tread some people mentioned jython. I went to read about it, but i was wondering if anyone has any real project done with it and can give real world

Re: error problems for import some copora with nltk

2004-12-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Thank you for answering this. I did exactly what you told me, but I got following messages. Do you have any idea? ImportError: No module named Numeric have you installed the Numeric library? see the NLTK download page for details:

Re: Problem with msvcrt60 vs. msvcr71 vs. strdup/free

2004-12-22 Thread abkhd
From: [EMAIL PROTECTED] Newsgroups: comp.lang.python Subject: Re: Problem with msvcrt60 vs. msvcr71 vs. strdup/free Date: Wed, 22 Dec 2004 11:07:02 -0800 Gerhard Haering wrote: Hello, I used to build Python extension modules with mingw. Now, Python has switched to the MSVCR71 runtime with

Re: Easy here documents ??

2004-12-22 Thread Jim Hill
Fredrik Lundh wrote: Jim Hill wrote: I'm trying to write a script that writes a script for a rather specialized task. I know that seems weird, but the original version was written in Korn shell and most of my team are familiar with the way it does things even though they don't read Korn. so

Re: list IndexError

2004-12-22 Thread Fredrik Lundh
Ishwor [EMAIL PROTECTED] wrote: i am trying to remove an item 'e' from the list l but i keep getting IndexError. I know the size of the list l is changing in the for loop its sort of trivial task but i found no other way than to suppress the IndexError by doing a pass. any other ways you

Re: list IndexError

2004-12-22 Thread Mike C. Fletcher
Ishwor wrote: i am trying to remove an item 'e' from the list l but i keep getting IndexError. I know the size of the list l is changing in the for loop its sort of trivial task but i found no other way than to suppress the IndexError by doing a pass. any other ways you guys can suggest? Also is

Re: regular expression: perl == python

2004-12-22 Thread John Machin
Fredrik Lundh wrote: JZ wrote: import re line = The food is under the bar in the barn. if re.search(r'foo(.*)bar',line): print 'got %s\n' % _.group(1) Traceback (most recent call last): File jz.py, line 4, in ? print 'got %s\n' % _.group(1) NameError: name '_'

Re: extract news article from web

2004-12-22 Thread Steve Holden
Zhang Le wrote: Hello, I'm writing a little Tkinter application to retrieve news from various news websites such as http://news.bbc.co.uk/, and display them in a TK listbox. All I want are news title and url information. Since each news site has a different layout, I think I need some

Re: list IndexError

2004-12-22 Thread Ishwor
On Wed, 22 Dec 2004 14:59:32 -0500, Mike C. Fletcher [EMAIL PROTECTED] wrote: [snip] Probably the most pythonic approach to this problem when dealing with small lists is this: result = [ item for item in source if item != 'e' ] or, if you're using an older version of Python without

  1   2   >