Re: UnicodeDecodeError

2005-11-30 Thread Fredrik Lundh
"ash" wrote: > one of the modules in my programs stopped wroking after i upgraded from > python 2.3 to 2.4. I also changed my wxPython to unicode supported one > during the process. > what the module essentially does is search for a stirng pattern form a > list of strings. > this is the function:

Re: python speed

2005-11-30 Thread bruno at modulix
David Rasmussen wrote: > Frithiof Andreas Jensen wrote: > >> >> From the speed requirement: Is that correspondance chess by any chance?? >> > > Regular chess at tournament time controls requires speed too. Any pure > Python chess program would lose badly to the best C/C++ programs out > there now

Re: wxGrid and Focus Event

2005-11-30 Thread Bugs
Paul McNett wrote: > > If I filed a proper bug report for everything wrong with > wxPython/wxWidgets, I'd probably not get anything else done. But on the > other hand you couldn't force me to stop using wxPython if you tried! > Like any open-source software, the community is what makes it bett

Re: an intriguing wifi http server mystery...please help

2005-11-30 Thread Istvan Albert
> The server is almost entirely based on the server found at: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259148 Try using a different python based webserver. This recipe might have some problems that cause the weird behavior. (The Karigell webframework uses a server based on this r

Re: python speed

2005-11-30 Thread Paul Boddie
Steven Bethard wrote: > David Rasmussen wrote: > Faster than assembly? LOL... :) > Faster than physics? ;-) > I think the claim goes something along the lines of "assembly is so hard > to get right that if you can automatically generate it from a HLL, not > only will it be more likely to be corre

Re: python speed

2005-11-30 Thread Paul Boddie
Peter Hansen wrote: > True, but so what? Why did you suddenly change the discussion to > require "pure" Python? Well, comments about Python's speed usually come in the following two forms: some Python-based solution isn't fast enough; programs written in Python aren't fast enough. In other words,

Re: an intriguing wifi http server mystery...please help

2005-11-30 Thread jojoba
Thanks Istvan, But if it's a problem with the software, why does the server work great when wired (i.e. not wireless)...that's the weird part. Thanks again, jojoba -- http://mail.python.org/mailman/listinfo/python-list

Re: python speed

2005-11-30 Thread Carsten Haese
On Wed, 2005-11-30 at 14:53, Paul Boddie wrote: > [...] the Java virtual machine > is suitably designed/specified to permit just-in-time complication. +1 Freudian slip of the week :) -Carsten Haese -- http://mail.python.org/mailman/listinfo/python-list

Re: XML and namespaces

2005-11-30 Thread A.M. Kuchling
On 30 Nov 2005 07:22:56 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> quoted: > >>> element = document.createElementNS("DAV:", "href") This call is incorrect; the signature is createElementNS(namespaceURI, qualifiedName). If you call .createElementNS('whatever', 'DAV:href'), the o

Re: General question about Python design goals

2005-11-30 Thread Mike Meyer
Paul Rubin writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> > An awful lot of the time in this newsgroup, "practicality beats >> > purity" translates as "the programmer can just be a lazy slob". >> You post that as if it were a bad thing. > Yes. The idea of using a pr

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
Paul Rubin writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> Letting the class author declare whether or not the client can add >> attributes is wrong for the same reasons - and in the same places - >> that letting the class author declare that the client shouldn't be >

Re: Which License Should I Use?

2005-11-30 Thread Robert Kern
Paul Boddie wrote: > Paul Rubin wrote: > >>That is the guy who claims it is impossible to release anything into >>the public domain, other than by dying and then waiting 70 years. > > Is that an indirect reference to the following article? > > http://www.linuxjournal.com/article/6225 Among othe

Re: python speed

2005-11-30 Thread igouy
Paul Boddie wrote: > Steven Bethard wrote: > > David Rasmussen wrote: > > Faster than assembly? LOL... :) > > > Faster than physics? ;-) > > > I think the claim goes something along the lines of "assembly is so > hard > > to get right that if you can automatically generate it from a HLL, > not > >

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I am puzzled, and could have read what you want wrong. Are you saying > you want something like this : > > a={} > a.something = "I want to hang my stuff here, outside the intended use > of dict" Exactly. For a use case, consider calling select.select on lists of file ob

Re: python speed

2005-11-30 Thread Isaac Gouy
Peter Hansen wrote: > David Rasmussen wrote: > > Frithiof Andreas Jensen wrote: > >>From the speed requirement: Is that correspondance chess by any chance?? > > > > Regular chess at tournament time controls requires speed too. Any pure > > Python chess program would lose badly to the best C/C++ pr

Re: Python as Guido Intended

2005-11-30 Thread Ben Finney
Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2005-11-29, Mike Meyer <[EMAIL PROTECTED]> wrote: > > Antoon Pardon <[EMAIL PROTECTED]> writes: > >> Mike Meyer wrote: > >>> You see, you can make languages more powerful by *removing* > >>> things from it. > >> You cast this in way to general terms. Th

Re: Distutils postinstall script: useless?

2005-11-30 Thread Mardy
Le die Wed, 30 Nov 2005 15:46:43 +, Mardy ha scribite: > the bdist_wininst command of distutils allows me to specify a script to > be executed at the end of the installation. That's great, but how can I > know the installation path from inside the script? Answering to myself, sys.prefix comb

Re: General question about Python design goals

2005-11-30 Thread Christoph Zwerschke
[EMAIL PROTECTED] wrote: > Paul Rubin wrote: >>Look at the list.count() example at the start of this thread. >>Diagnosing it isn't hard. Curing it isn't hard. It doesn't bloat >>Python by an order of magnitude. A suitably factored implementation >>might handle lists and strings with the exact sa

Re: After migrating from debian to ubuntu, tkinter "hello world" doesn't work

2005-11-30 Thread Mandus
30 Nov 2005 04:23:37 -0800 skrev [EMAIL PROTECTED]: > > Mandus ha escrito: > >> works just fine on my ubunty 5.10. Make sure you have the python2.4-tk >> package installed (sudo apt-get install python2.4-tk). >> > > yes, i got it. > It's a fresh instalation from a cd in a brand new laptop. I tried

Re: Python as Guido Intended

2005-11-30 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > On 2005-11-29, Mike Meyer <[EMAIL PROTECTED]> wrote: >> Antoon Pardon <[EMAIL PROTECTED]> writes: You see, you can make languages more powerful by *removing* things from it. >>> You cast this in way to general terms. The logic conclusion >>> fro

ANN: Dabo 0.5 released!

2005-11-30 Thread Ed Leafe
We are pleased to announce Dabo 0.5, the fifth major release of our data application framework. The Dabo framework is a true 3-tier design, with data access and UI code separated from your business logic. And since it's Python, and uses wxPython for its UI, it is completely cross-platform,

Re: wxPython installation issues on Debian

2005-11-30 Thread Kenneth Pronovici
> Thanks for the suggestion, but an apt-cache search python2.4-wxgtk2.4 > returns no results for a package with that name. As you observed, the Debian wxPython packages currently only support one version of Python at a time. That decision ripples down and ends up affecting a number of other thin

Re: python speed

2005-11-30 Thread Peter Hansen
Isaac Gouy wrote: > Peter Hansen wrote: >>Judging by the other posts in this thread, the gauntlet is down: Python >>is faster than Java. Let those who believe otherwise prove their point >>with facts, and without artificially handcuffing their opponents with >>non-real-world "purity" requirements.

Re: python speed

2005-11-30 Thread Mike Meyer
"Harald Armin Massa" <[EMAIL PROTECTED]> writes: >>Faster than assembly? LOL... :) > why not? Of course, a simple script like "copy 200 bytes from left to > right" can be handoptimized in assembler and run at optimum speed. > Maybe there is even a special processor command to do that. Chances are

Re: Distutils postinstall script: useless?

2005-11-30 Thread Thomas Heller
Mardy <[EMAIL PROTECTED]> writes: > Le die Wed, 30 Nov 2005 15:46:43 +, Mardy ha scribite: >> the bdist_wininst command of distutils allows me to specify a script to >> be executed at the end of the installation. That's great, but how can I >> know the installation path from inside the scrip

Re: wxPython installation issues on Debian

2005-11-30 Thread [EMAIL PROTECTED]
Hi Ken, Thanks a lot for the clarification. I don't have a compelling reason not to use 2.3 other than having to install the modules I've already set up for 2.4. Not really a big deal. Looks like I'll be switching to 2.3. Thanks again, Aaron -- http://mail.python.org/mailman/listinfo/python-lis

Re: python speed

2005-11-30 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > "Harald Armin Massa" <[EMAIL PROTECTED]> writes: > >>Faster than assembly? LOL... :) > > why not? Of course, a simple script like "copy 200 bytes from left to > > right" can be handoptimized in assembler and run at optimum s

Re: python speed

2005-11-30 Thread Isaac Gouy
Peter Hansen wrote: > Isaac Gouy wrote: > > Peter Hansen wrote: > >>Judging by the other posts in this thread, the gauntlet is down: Python > >>is faster than Java. Let those who believe otherwise prove their point > >>with facts, and without artificially handcuffing their opponents with > >>non-

Re: Nested loop

2005-11-30 Thread Bengt Richter
On 30 Nov 2005 00:37:43 -0800, [EMAIL PROTECTED] wrote: > >viewcharts wrote: >> I am reading two text files comparing the values in one to the other, >> this requires two loops. The problem is that when the inner loop is >> finished, it never goes back into the loop. Any suggestions? >> >> >> for

how to handle two forms in cgi?

2005-11-30 Thread lli
Hi Guys, I am a new cgi programmer. Now I need to design a web application: 1. first, user login by their username and password in a form (login form). When users click submit button it connect to database and check user name and password in a table. If it match in a table, form1.py should show se

Re: Oracle 9i client for Linux

2005-11-30 Thread Damjan
This is a list of files I use to compile cx_Oracle, php-oci amd perl DB::OCI on Linux. I set ORACLE_HOME to /usr/lib/oracle and symlink the *.so files in /usr/lib so that I don't need to set LD_LIBRARY_PATH. I guess this list can be reduced some more... but I got tired of experimenting And the ins

Re: python speed

2005-11-30 Thread Peter Hansen
Donn Cave wrote: > I read yesterday morning in the paper that the Goto Basic Linear > Algebra Subroutines, by a Mr. Kazushige Goto, are still the most > efficient library of functions for their purpose for use in > supercomputing applications. Apparently hand-optimized assembler > for specific pro

Re: python speed

2005-11-30 Thread Paul Boddie
Carsten Haese wrote: > On Wed, 2005-11-30 at 14:53, Paul Boddie wrote: > > [...] the Java virtual machine > > is suitably designed/specified to permit just-in-time complication. > > +1 Freudian slip of the week :) Well, I never said it was easy. ;-) Paul -- http://mail.python.org/mailman/listin

Re: (newbie) N-uples from list of lists

2005-11-30 Thread Martin Miller
FWIW, I found Steven Taschuk's solution easiest to understand regarding the question posed in your original post -- namely how to solve the problem non-recursively with generators -- because it was similar to my own thinking about how to do it -- but suspect that Raymond Hettinger's is the likely t

Re: cheese shop registration error

2005-11-30 Thread richard
Todd Greenwood-Geer wrote: > I'd like to publish to PyPI. I'm assuming that this is open to anyone. Correct. > REPRO: > - - open cheeseshop reg form > http://cheeseshop.python.org/pypi?%3Aaction=register_form > > - - fill out registration form as follows: > Username: tgreenwood > Password: some

Re: python speed

2005-11-30 Thread [EMAIL PROTECTED]
Isaac Gouy wrote: > Peter Hansen wrote: > > Isaac Gouy wrote: > > > Peter Hansen wrote: > > >>Judging by the other posts in this thread, the gauntlet is down: Python > > >>is faster than Java. Let those who believe otherwise prove their point > > >>with facts, and without artificially handcuffing

Re: how to handle two forms in cgi?

2005-11-30 Thread Dan M
> My question is: How let these two form works together? I try to use > two codes for these two forms, e.g. Login.py for login form and > search.py for search form. But when user input data in search form and > click its submit button, it just comes back to login form. Second form > doesn't work.

help python swig problem

2005-11-30 Thread [EMAIL PROTECTED]
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c */ #include double My_variable = 3.0; int fact(int n) { if (n <= 1) return 1; else return

A bug in struct module on the 64-bit platform?

2005-11-30 Thread [EMAIL PROTECTED]
Hi, I have a user who complained about how "struct" module computes C struct data size on Itanium2 based 64-bit machine. His first reproducer was -- #!/usr/local/bin/python import struct fmthead = '12id5i5d7id5i3di12i3di' fmtsize = struct.calcsize(fmthead) prin

Re: cheese shop registration error

2005-11-30 Thread skip
>> smtplib.SMTPRecipientsRefused: {u'tgreenwoodgeer.yahoo.com': (550, >> ': Recipient address rejected: User unknown >> in local recipient table')} richard> The error displayed here is complaining about the email address richard> you supplied, 'tgreenwoodgeer.yahoo.com'. This

Re: importing a method

2005-11-30 Thread Martin Miller
Sorry, I seldom look at the built-in __doc__ strings or use the 'help()' function. Instead I usually refer to the html or winhelp versions of the documentation, and for Python 2.4.1 there's nothing in section 3.28 on the 'new' module that mentions that it deprecated -- so thanks to you and Flávio

Re: importing a method

2005-11-30 Thread Martin Miller
You're not missing anything -- it's my own [mis-]understanding that descriptors would only work with new-style classes, not the old-style ones used in the OP's example. However your example certainly proves that is not the case, even if you go one step further and call the bound method/function: >

Python Guru Needed Fast!!!!

2005-11-30 Thread j-rock
Talking Panda LLC is looking for a programmer to take over building applications for the iPod. Required skills below. Please email me personally. [EMAIL PROTECTED] - Expertise in text parsing and formatting. Specifically, developing parsers to extract meaningful information from freeform text, XM

Re: wxPython installation issues on Debian

2005-11-30 Thread Paul McNett
[EMAIL PROTECTED] wrote: > Thanks a lot for the clarification. I don't have a compelling reason > not to use 2.3 other than having to install the modules I've already > set up for 2.4. Not really a big deal. Looks like I'll be switching to > 2.3. Umm, for what it's worth: I'm on Ubuntu (a Debian d

Re: wxPython installation issues on Debian

2005-11-30 Thread Robert Kern
Paul McNett wrote: > [EMAIL PROTECTED] wrote: > >>Thanks a lot for the clarification. I don't have a compelling reason >>not to use 2.3 other than having to install the modules I've already >>set up for 2.4. Not really a big deal. Looks like I'll be switching to >>2.3. > > Umm, for what it's wort

Code returns error when not supposed to

2005-11-30 Thread amfr
This code always returns a ValueError when it is not supposed to: i = rest.rfind('?') Error: ValueError: need more than 0 values to unpack rfind is not supposed to generate an erro, just return -1. Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: Code returns error when not supposed to

2005-11-30 Thread amfr
Never mind, figured out -- http://mail.python.org/mailman/listinfo/python-list

Re: an intriguing wifi http server mystery...please help

2005-11-30 Thread Istvan Albert
> But if it's a problem with the software, why does the server work > great when wired (i.e. not wireless)...that's the weird part. Don't be so quick to eliminate software error ... when it comes to bugs there are few rules. You are using a recipe that is *known* to produce weird behavior. Make

Re: wxPython installation issues on Debian

2005-11-30 Thread Paul McNett
Robert Kern wrote: > Although Ubuntu is a Debian derivative, it does have different packages. > At the moment, Debian's default Python is 2.3 although one can also > install Python 2.4, and most Python packages in Debian have been built > for both (that's why I erroneously recommended installing th

Re: wxPython installation issues on Debian

2005-11-30 Thread Robert Kern
Paul McNett wrote: > Robert Kern wrote: > >>Although Ubuntu is a Debian derivative, it does have different packages. >>At the moment, Debian's default Python is 2.3 although one can also >>install Python 2.4, and most Python packages in Debian have been built >>for both (that's why I erroneously r

One module cannot be found by the interpreter

2005-11-30 Thread Anthony Liu
I downloaded and built the python/c++ maxent package ( http://homepages.inf.ed.ac.uk/s0450736/maxent_toolkit.html ). I don't know what happened, the interpreter cannot find the cmaxent module, whereas cmaxent.py is right under the current directory. >>> from maxent import * cmaxent module not fo

Re: How could I ask Thread B to call B().Method() from inside Thread A's run?

2005-11-30 Thread could ildg
Thank you.On 30 Nov 2005 09:30:23 -0800, NavyJay <[EMAIL PROTECTED]> wrote: I agree with jmj's solution, you would want to send a signal of somesort to Thread B from A when some event occurs in A.  A queue is oneway to do it, but keep in mind that there are numerous ways tocommunicate between threa

How to list currently defined classes, methods etc

2005-11-30 Thread Deep
If i start a python shell. Is there a way to list the currently defined classes, methods, variables? -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-11-30 Thread sszmidt
Please trim replies... ; ) -- Steve -- http://mail.python.org/mailman/listinfo/python-list

Is Python string immutable?

2005-11-30 Thread could ildg
In java and C# String is immutable, str=str+"some more" will return a new string and leave some gargabe. so in java and C# if there are some frequent string operation, StringBuilder/StringBuffer is recommanded.   Will string operation in python also leave some garbage? I implemented a net-spider i

Re: How to list currently defined classes, methods etc

2005-11-30 Thread Peter Hansen
Deep wrote: > If i start a python shell. Is there a way to list the currently defined > classes, methods, > variables? Does this work? >>> dir() -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-30 Thread bonono
Christoph Zwerschke wrote: > [EMAIL PROTECTED] wrote: > > Paul Rubin wrote: > >>Look at the list.count() example at the start of this thread. > >>Diagnosing it isn't hard. Curing it isn't hard. It doesn't bloat > >>Python by an order of magnitude. A suitably factored implementation > >>might ha

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > > I am puzzled, and could have read what you want wrong. Are you saying > > you want something like this : > > > > a={} > > a.something = "I want to hang my stuff here, outside the intended use > > of dict" > > Exactly. For a use case, consider calli

Re: (newbie) N-uples from list of lists

2005-11-30 Thread bonono
Interesting, I found a reduce one liner(just one step further of Raymond's) easiest to understand and match my thinking about what the problem is about. That once again tell me that different people think and approach the problem differently. It is possible to talk about one "fastest" way, but man

Re: How to list currently defined classes, methods etc

2005-11-30 Thread Deep
yes that works. but, it gives one list, which contains everything. now about inferring types? :) -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-30 Thread Chris Mellon
On 11/30/05, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Paul Rubin wrote: > >>Look at the list.count() example at the start of this thread. > >>Diagnosing it isn't hard. Curing it isn't hard. It doesn't bloat > >>Python by an order of magnitude. A suitably fact

Recursion bug...

2005-11-30 Thread ex_ottoyuhr
To start with, I'm new at Python, so if this is something relatively ordinary or a symptom of thinking in C++, I apologize... Anyhow, I'm currently trying to write a means of generating genetic-programming functions in Python; the details would be a little much for a Usenet post, but suffice it to

Re: Is Python string immutable?

2005-11-30 Thread Chris Mellon
On 11/30/05, could ildg <[EMAIL PROTECTED]> wrote: > In java and C# String is immutable, str=str+"some more" will return a new > string and leave some gargabe. > so in java and C# if there are some frequent string operation, > StringBuilder/StringBuffer is recommanded. > > Will string operation in

Re: How to list currently defined classes, methods etc

2005-11-30 Thread Bengt Richter
On Wed, 30 Nov 2005 20:55:46 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >Deep wrote: >> If i start a python shell. Is there a way to list the currently defined >> classes, methods, >> variables? > >Does this work? > > >>> dir() > >>> help(__name__) might be interesting for the OP too ;-) R

Newbie: Python & Serial Port question

2005-11-30 Thread Sanjay Arora
Am a python newbie. Does python have a native way to communicate with a PC serial port? I found that pyserial needs java. I am using Linux..CentOS 4.2, to be exact, no java installed and zilch/no/none/maybe never experience of java too. I have an application where I want to resd logs from the ser

HTML parsing/scraping & python

2005-11-30 Thread Sanjay Arora
We are looking to select the language & toolset more suitable for a project that requires getting data from several web-sites in real- timehtml parsing/scraping. It would require full emulation of the browser, including handling cookies, automated logins & following multiple web-link paths. Mul

Re: Recursion bug...

2005-11-30 Thread Devan L
ex_ottoyuhr wrote: > To start with, I'm new at Python, so if this is something relatively > ordinary or a symptom of thinking in C++, I apologize... > > Anyhow, I'm currently trying to write a means of generating > genetic-programming functions in Python; the details would be a little > much for a

Re: importing a method

2005-11-30 Thread Alex Martelli
Martin Miller <[EMAIL PROTECTED]> wrote: > You're not missing anything -- it's my own [mis-]understanding that > descriptors would only work with new-style classes, not the old-style > ones used in the OP's example. > > However your example certainly proves that is not the case, even if you > go

Re: How to list currently defined classes, methods etc

2005-11-30 Thread Deep
Awesome just what i was looking for now sheepishly i shall RTFM :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Python & Serial Port question

2005-11-30 Thread Kinsley Turner
[EMAIL PROTECTED] wrote on 30/11/2005 07:48:39 PM: > Am a python newbie. Does python have a native way to communicate with a > PC serial port? I found that pyserial needs java. > > I am using Linux..CentOS 4.2, to be exact, no java installed and > zilch/no/none/maybe never experience of java t

Re: Recursion bug...

2005-11-30 Thread bonono
ex_ottoyuhr wrote: > class TreeCommand: > opcode = 0 > children = [] > def __init__(self, anOpcode) : > opcode = anOpcode > opcode and children in this case is more like "class" variable in C++. If you want "instance" variable, you need to do it as self.opcode, self.children, i

Pydoc: restrict base class doc?

2005-11-30 Thread Tony Nelson
I'd like to prevent Pydoc from adding base class documentation for some of my classes. Specifically, I have a couple of classes that derive from GTK widgets, and dumping all that documentation in doesn't have much benefit. Is there some thing I can do in my source, or to Pydoc, to tell it to

Re: wxPython installation issues on Debian

2005-11-30 Thread Chris Mellon
On 11/30/05, Robert Kern <[EMAIL PROTECTED]> wrote: > Paul McNett wrote: > > Robert Kern wrote: > > > >>Although Ubuntu is a Debian derivative, it does have different packages. > >>At the moment, Debian's default Python is 2.3 although one can also > >>install Python 2.4, and most Python packages i

Re: Recursion bug...

2005-11-30 Thread ex_ottoyuhr
Devan L wrote: > Well, for one, in your __init__ method, you never do anything with > anOpcode. You simply assign the name 'opcode' to anOpcode. The reason > why everything is the same is that you're accessing > TreeCommand.children or Treecommand.opcode, which is shared by all > instances unles

Re: Recursion bug...

2005-11-30 Thread ex_ottoyuhr
[EMAIL PROTECTED] wrote: > ex_ottoyuhr wrote: > > class TreeCommand: > > opcode = 0 > > children = [] > > def __init__(self, anOpcode) : > > opcode = anOpcode > > > opcode and children in this case is more like "class" variable in C++. > If you want "instance" variable, you nee

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer wrote: >> [EMAIL PROTECTED] writes: >> > I am puzzled, and could have read what you want wrong. Are you saying >> > you want something like this : >> > a={} >> > a.something = "I want to hang my stuff here, outside the intended use >> > of dict" >> Exactly. Fo

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > Built-in types don't have a real dictionary. They have a C struct that > holds the various methods. The entries in the struct are called > "slots", hence the __slots__ magic attribute. That __slots__ makes it > impossible to add an attribute is documented as an implementation

Re: wxPython - processes

2005-11-30 Thread novitk
ccahoon wrote: > In wxPython, I want to be able to start downloading a file and have the > window doing such remain interactive, so that the user can cancel > downloading the next file. Also, if there is a way to cancel a > downloading process, what is it? > > I am using urllib.urlretrieve. Thank

Re: HTML parsing/scraping & python

2005-11-30 Thread Mike Meyer
Sanjay Arora <[EMAIL PROTECTED]> writes: > We are looking to select the language & toolset more suitable for a > project that requires getting data from several web-sites in real- > timehtml parsing/scraping. It would require full emulation of the > browser, including handling cookies, automat

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Well, in this case, would it be simple for the OP that if he wants to > disallow this attaching additional things, just use __slot__. That's *documented* as an implementation-dependent behavior. Using it to get that effect is abuse of the feature, and may well quit work

Re: How to list currently defined classes, methods etc

2005-11-30 Thread Alex Martelli
Deep <[EMAIL PROTECTED]> wrote: > yes that works. > but, it gives one list, which contains everything. > now about inferring types? :) You may want to look at module inspect in the standard library. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > > If the authors go to the length of not allowing it, so be it. They > > are afterall define it for their use and how someone else will use > > it don't matter. > > I take it you never distribute your code, or otherwise expect other > people to reuse it? > No, distribute when n

Re: improving pypi / setuptools

2005-11-30 Thread Alia Khouri
It is still early days for setuptools... still, we are lagging behind the ruby world in this regards. I definitely agree with you that the so-called megaframeworks need to be packaged better (especially all versions of the different components being updated on almost daily basis). AK -- http://

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > > Well, in this case, would it be simple for the OP that if he wants to > > disallow this attaching additional things, just use __slot__. > > That's *documented* as an implementation-dependent behavior. Using it > to get that effect is abuse of the f

Python CGI

2005-11-30 Thread jbrewer
I need to update a CGI script I have been working on to perform validation of input files. The basic idea is this: 1.) HTML page is served 2.) User posts file and some other info 3.) Check file for necessary data * If data is missing, then post a 2nd page requesting needed data * If data

The pythonic way

2005-11-30 Thread Somesh
Hi, I have started reWriting the stuffs under header 'The Pythonic way !', the small code segments are kept at http://guruvision.in/ , pl let me know more topics ideas to write, work. is there anyone who has worked with python in geometry/maths domain ? - somesh -- http://mail.python.org/mailman

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > > Well, in this case, would it be simple for the OP that if he wants to > > disallow this attaching additional things, just use __slot__. > > That's *documented* as an implementation-dependent behavior. Using it > to get that effect is abuse of the f

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > And again, *what's the use case*? A number of people have asked why we > shouldn't allow this, but none of them been able to come up with a use > case better than "I think doing that is bad style." > oh, that is the usual argument anyway. It is nothing but style, most of the ti

RE: Making immutable instances

2005-11-30 Thread Delaney, Timothy (Tim)
Was it *really* necessary to send 4 separate emails to reply to four sections of the same email? Good netiquette is to intersperse your comments with quoted sections in a single email. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-30 Thread Chris Mellon
On 11/30/05, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > Paul Rubin wrote: > Look at the list.count() example at the start of this thread. > Diagnosing it isn't hard. Curing it isn't hard. It doesn't bloat > Python by an order of magnitude. A suitably factored imp

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer wrote: >> [EMAIL PROTECTED] writes: >> > Well, in this case, would it be simple for the OP that if he wants to >> > disallow this attaching additional things, just use __slot__. >> That's *documented* as an implementation-dependent behavior. Using it >> to get

Re: sax.make_parser() segfaults

2005-11-30 Thread Frank Millman
Frank Millman wrote: > > Hi all > > > > I am using Python 2.4.1. I have machines running FC4, RH9, and MSW > > Server 2003 for testing. > > > > If I call sax.make_parser() from the interpreter or from a stand-alone > > program, it works fine on all machines, but in the following setup it > > works

Re: an intriguing wifi http server mystery...please help

2005-11-30 Thread jojoba
Hi again Istvan, Good suggestion. I have tried another server and it works flawlessly, regardless of the computers being wireless or wired. Excellent. However, i am still intrigued as to why the server is fast when both computers are wireless and the desktop is the server (while the laptop is the

Re: A bug in struct module on the 64-bit platform?

2005-11-30 Thread Neal Norwitz
[EMAIL PROTECTED] wrote: > Hi, > > I have a user who complained about how "struct" module computes C > struct data size on Itanium2 based 64-bit machine. I wouldn't be surprised, but I don't understand the problem. >>>struct.calcsize('idi') >16 >>>struct.calcsize('idid') >24 >

Re: Newbie: Python & Serial Port question

2005-11-30 Thread Peter Hansen
Sanjay Arora wrote: > Am a python newbie. Does python have a native way to communicate with a > PC serial port? I found that pyserial needs java. This is not true unless you are using Jython. The code in serial/__init__.py does this: if os.name == 'nt': #sys.platform == 'win32': from seria

Re: python speed

2005-11-30 Thread Mohammad Jeffry
I did a small test some time ago and I think python is faster then java: http://linuxlah.blogspot.com/2005/11/swap-speed-for-python-c-c-and-java.html On 11/30/05, Krystian <[EMAIL PROTECTED]> wrote: Hiare there any future perspectives for Python to be as fast as java? iwould like to use Python as

Re: Making immutable instances

2005-11-30 Thread bonono
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > > Mike Meyer wrote: > >> [EMAIL PROTECTED] writes: > >> > Well, in this case, would it be simple for the OP that if he wants to > >> > disallow this attaching additional things, just use __slot__. > >> That's *documented* as an implementation-depende

Re: General question about Python design goals

2005-11-30 Thread Donn Cave
Quoth [EMAIL PROTECTED]: | Christoph Zwerschke wrote: ... |> Sorry, but I still do not get it. Why is it a feature if I cannot count |> or find items in tuples? Why is it bad program style if I do this? So |> far I haven't got any reasonable explanation and I think there is no. | | I have no idea,

Re: python speed

2005-11-30 Thread elbertlev
Isaac Gouy wrote: > Which stated "Python is doing the heavy lifting with GMPY which is a > compiled C program with a Python wrapper" - but didn't seem to compare > that to GMPY with a Java wrapper? You are missing the main idea: Java is by design a general purpose programming language. That's why

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Quoting the frequently used term "Practicality beats purity". If I have > a practical problem/needs now and it solves it, why not use it ? In other words, you have a use case. Cool. Please tell us what it is - at least if it's better than "I think that's bad style."

<    1   2   3   >