Re: setup.py and file extensions like ".c++"

2006-08-24 Thread Glenn Hutchings
[EMAIL PROTECTED] wrote: > Is there any way to get setup.py to recognize file extensions like .c++ > in lieu of .cpp? I'd love to not have to rename the source files for > the library I'm trying to wrap in a python C extension. The python docs imply that the file extension is dealt with by the na

Re: pickling and endianess

2006-08-24 Thread Chandrashekhar Kaushik
>> What about old ASCII?    The data is large .it also contains floats & double , so ascii will cause two problems -> loss of precision and the data will bloat  --shekhar -- http://mail.python.org/mailman/listinfo/python-list

Re: lazy arithmetic

2006-08-24 Thread Gabriel G
At Friday 25/8/2006 02:18, [EMAIL PROTECTED] wrote: > x+y get translated to x.__add__(y) No that's not true at all. The self argument to __add__ ends up being the Add instance, not the Item instance: z=x+y is translated to z.__add__(y) Well, I deleted my response after I noticed that Simon

Re: pickling and endianess

2006-08-24 Thread Gabriel Genellina
At Friday 25/8/2006 03:37, Chandrashekhar Kaushik wrote: I dont think i really need that much . Just need to be able to send data across the network and then retrieve it properly independent of the architecture at the remote end :) What about old ASCII? Gabriel Genellina Softlab SRL

Re: pickling and endianess

2006-08-24 Thread Chandrashekhar Kaushik
The pickletools.py seems to be giving cool info on the same ( the PM virual machine and all ). Will try to salvage something out of that. I dont think i really need that much . Just need to be able to send data across the network and then retrieve it properly independent of the architecture at the

Re: pickling and endianess

2006-08-24 Thread Gabriel Genellina
At Friday 25/8/2006 03:17, Chandrashekhar Kaushik wrote: I am actually looking to implement serialization routines in C++. An am facing the problem of how to tackle endianess and sizeof issues. Could you give me a overview of how pickling is done in python ? Reading pickle.py is obviously the

Re: pickling and endianess

2006-08-24 Thread Fredrik Lundh
Chandrashekhar Kaushik wrote: > Thank you for the information. > A request though. > > I am actually looking to implement serialization routines in C++. > An am facing the problem of how to tackle endianess and sizeof issues. > > Could you give me a overview of how pickling is done in python ? R

Re: pickling and endianess

2006-08-24 Thread Chandrashekhar Kaushik
Thank you for the information.A request though.I am actually looking to implement serialization routines in C++.An am facing the problem of how to tackle endianess and sizeof issues.Could you give me a overview of how pickling is done in python ? Reading pickle.py is obviously the option , but its

Re: Is this a good idea or a waste of time?

2006-08-24 Thread Simon Forman
asincero wrote: > Would it be considered good form to begin every method or function with > a bunch of asserts checking to see if the parameters are of the correct > type (in addition to seeing if they meet other kinds of precondition > constraints)? Like: > > def foo(a, b, c, d): >ass

Re: pickling and endianess

2006-08-24 Thread Tim Peters
[Chandrashekhar kaushik] > Can an object pickled and saved on a little-endian machine be unpickled > on a big-endian machine ? Yes. The pickle format is platform-independent (native endianness doesn't matter, and neither do the native sizes of C's various integer types). > Does python handle thi

Re: pickling and endianess

2006-08-24 Thread Fredrik Lundh
Chandrashekhar kaushik wrote: > Can an object pickled and saved on a little-endian machine be unpickled > on a big-endian machine ? yes. the format uses a known byte order. -- http://mail.python.org/mailman/listinfo/python-list

Re: lazy arithmetic

2006-08-24 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Simon Forman wrote: > > > > > "Item.__add__ = Add" is a very strange thing to do, I'm not surprised > > it didn't work. > > Yes it is strange. > I also tried this even stranger thing: > > class Item(object): > class __add__(object): > def __init__(self, a, b=None):

Re: lazy arithmetic

2006-08-24 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Gabriel Genellina wrote: > > At Friday 25/8/2006 00:36, [EMAIL PROTECTED] wrote: > > > > ># This is what I have in mind: > > > > > >class Item(object): > > > def __add__(self, other): > > > return Add(self, other) > > > > And this works fine... why make thinks compl

Re: Is this a good idea or a waste of time?

2006-08-24 Thread Qiangning Hong
On 24 Aug 2006 20:53:49 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > That's bad form. If you insist on doing something like this, at least > use "isinstance(a, str)" instead of typeof. But even that breaks duck > typing; if a is a unicode string, that'll fail when the function may > work

Re: lazy arithmetic

2006-08-24 Thread pianomaestro
Simon Forman wrote: > > "Item.__add__ = Add" is a very strange thing to do, I'm not surprised > it didn't work. Yes it is strange. I also tried this even stranger thing: class Item(object): class __add__(object): def __init__(self, a, b=None): print self, a, b self.a = a

Re: lazy arithmetic

2006-08-24 Thread pianomaestro
Gabriel Genellina wrote: > At Friday 25/8/2006 00:36, [EMAIL PROTECTED] wrote: > > ># This is what I have in mind: > > > >class Item(object): > > def __add__(self, other): > > return Add(self, other) > > And this works fine... why make thinks complicated? Yes, I agree it's simpler, and up u

pickling and endianess

2006-08-24 Thread Chandrashekhar kaushik
Can an object pickled and saved on a little-endian machine be unpickledon a big-endian machine ? Does python handle this in some manner  , by say having a flag to indicatethe endianess of the machine on which the object was pickled ?  And then using this flag to decide how that data will be unpick

Re: RE Module

2006-08-24 Thread Simon Forman
Roman wrote: > I am trying to filter a column in a list of all html tags. What? > To do that, I have setup the following statement. > > row[0] = re.sub(r'<.*?>', '', row[0]) > > The results I get are sporatic. Sometimes two tags are removed. > Sometimes 1 tag is removed. Sometimes no tags are

Re: lazy arithmetic

2006-08-24 Thread Simon Forman
[EMAIL PROTECTED] wrote: > # This is what I have in mind: > > class Item(object): > def __add__(self, other): > return Add(self, other) > > class Add(Item): > def __init__(self, a, b): > self.a = a > self.b = b > > a = Item() > b = Item() > > c = a+b > > # Now, I am going absolutely

Re: lazy arithmetic

2006-08-24 Thread Gabriel Genellina
At Friday 25/8/2006 00:36, [EMAIL PROTECTED] wrote: # This is what I have in mind: class Item(object): def __add__(self, other): return Add(self, other) And this works fine... why make thinks complicated? # Now, I am going absolutely crazy with this idea # and using it in a big way. S

Re: sum and strings

2006-08-24 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > There is an alternative: raise a warning instead of an exception. That > permits the admirable strategy of educating users that join() is > generally a better way to concatenate a large number of strings, while > still allowing programmers who want to s

Re: Best Practices for Python Script Development?

2006-08-24 Thread Richard Jones
metaperl wrote: > Searching cheeseshop.python.org/pypi for getopt modules does not work > very well by the way. http://docs.python.org/lib/module-getopt.html Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-24 Thread Steven D'Aprano
On Thu, 24 Aug 2006 18:24:19 +0200, Fredrik Lundh wrote: > besides, in all dictionaries I've consulted, the word "sum" means > "adding numbers". are you sure it wouldn't be more predictable if "sum" > converted strings to numbers ? And then on Thu, 24 Aug 2006 19:12:17 +0200 Fredrik also wrote

Re: how do you get the name of a dictionary?

2006-08-24 Thread Steven D'Aprano
On Wed, 23 Aug 2006 12:16:45 +0200, Fredrik Lundh wrote: > Steven D'Aprano wrote: > >> Here's a traceback. One of the arguments to spam() is too small. Can you >> tell which one just by looking at the traceback? >> > a, b, c, d = range(4) > spam(a, b, c, d) >> Traceback (most recent call

RE Module

2006-08-24 Thread Roman
I am trying to filter a column in a list of all html tags. To do that, I have setup the following statement. row[0] = re.sub(r'<.*?>', '', row[0]) The results I get are sporatic. Sometimes two tags are removed. Sometimes 1 tag is removed. Sometimes no tags are removed. Could somebody tell me

Re: how do you get the name of a dictionary?

2006-08-24 Thread Steven D'Aprano
On Wed, 23 Aug 2006 11:16:17 +0200, Sybren Stuvel wrote: > Steven D'Aprano enlightened us with: >> But an upside is that it would enable more useful error messages, at least >> sometimes. Here's some trivial pseudo-code: >> >> def foo(a): >> assert len(a) > 10, "%s is too short" % a.__name__ >

Re: Is this a good idea or a waste of time?

2006-08-24 Thread [EMAIL PROTECTED]
asincero wrote: > Would it be considered good form to begin every method or function with > a bunch of asserts checking to see if the parameters are of the correct > type (in addition to seeing if they meet other kinds of precondition > constraints)? Like: > > def foo(a, b, c, d): >ass

lazy arithmetic

2006-08-24 Thread pianomaestro
# This is what I have in mind: class Item(object): def __add__(self, other): return Add(self, other) class Add(Item): def __init__(self, a, b): self.a = a self.b = b a = Item() b = Item() c = a+b # Now, I am going absolutely crazy with this idea # and using it in a big way. So

Re: Best Editor

2006-08-24 Thread assiss
some wxPy IDEs maybe better. > Friends, I am trying to learn Python. > It will be of great help to me if you let me know which one would be best > editor for learning Python. > Plese note that I would like to have multiplatform editor which will be > useful for both LInux and Windows XP. > Thank

Re: Taking data from a text file to parse html page

2006-08-24 Thread DH
SE looks very helpful... I'm having a hell of a time installing it though: - [EMAIL PROTECTED]:~/Desktop/SE-2.2$ sudo python SETUP.PY install running install running build running build_py file SEL.py (for mod

Re: Best Practices for Python Script Development?

2006-08-24 Thread Robert Kern
metaperl wrote: > Usage > = > Most scripts will be run from cron and so should be driveable via > command-line options. > > optparse looks very good to me. And I had never thought about > required versus optional arguments in the way that it does. What an > eye-opener. > > Searching cheesesh

dictionaries vs. objects

2006-08-24 Thread Andre Meyer
Hi allI have the following question: I need a representation of a physically inspired environment. The environment contains a large number of objects with varying attributes. There may be classes of objects, but there is not necessarily a strictly defined hierarchy among them. Object access should

Best Practices for Python Script Development?

2006-08-24 Thread metaperl
Hello, I am responsible for converting 30 loosey-goosey Perl scripts into 30 well-documented easy to understand and use Python scripts. No one has said anything in particular about how this should be done, but the end product should be "professional" looking. So, I'm looking for some books and su

Re: Is this a good idea or a waste of time?

2006-08-24 Thread hiaips
asincero wrote: > Would it be considered good form to begin every method or function with > a bunch of asserts checking to see if the parameters are of the correct > type (in addition to seeing if they meet other kinds of precondition > constraints)? Like: > > def foo(a, b, c, d): >as

Re: When is a subclass not right?

2006-08-24 Thread Gabriel Genellina
At Thursday 24/8/2006 19:51, Chaz Ginger wrote: >> I was writing some code that used someone else class as a subclass. He >> wrote me to tell me that using his class as a subclass was incorrect. I >> am wondering under what conditions, if ever, does a class using a >> subclass not work. >> >> cl

setup.py and file extensions like ".c++"

2006-08-24 Thread garyjefferson123
Is there any way to get setup.py to recognize file extensions like .c++ in lieu of .cpp? I'd love to not have to rename the source files for the library I'm trying to wrap in a python C extension. I get: error: unknown file type '.c++' (from 'parser.c++') when I type 'python setup.py build' th

Re: OS X and Python - what is your install strategy?

2006-08-24 Thread hiaips
metaperl wrote: > I'm about to get a new OS X box on which I will rewrite a bunch of data > munging scripts from Perl to Python. I know that there are several port > services for OS X (fink, darwin ports, opendarwin). So I am not sure > whether to use their port of Python or whether to build from

Re: OS X and Python - what is your install strategy?

2006-08-24 Thread skip
[ mp asks what version of Python to install on Mac OSX ] I just do a Unix build from the Subversion repository. I do have fink installed, so some of the external libraries match up there. Also, the Mac's readline module is really libedit, which doesn't provide enough functionality for Python's

Re: Python editor

2006-08-24 Thread Jason Jiang
Thanks Simon. I finally picked SciTE. No time to do further investigation. Jason "Simon Forman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jason Jiang wrote: >> Hi, >> >> Could someone recommend a good Python editor? Thanks. >> >> Jason > > There have just been one or two long

Re: List problem

2006-08-24 Thread Larry Bates
[EMAIL PROTECTED] wrote: > For example i write the following code in the Python command line; > list = ['One,Two,Three,Four'] > > Then enter this command, which will then return the following; > > ['One,Two,Three,Four'] > > > Now the problem, reading through the Python tutorial's, it desc

Re: OS X and Python - what is your install strategy?

2006-08-24 Thread Diez B. Roggisch
metaperl schrieb: > I'm about to get a new OS X box on which I will rewrite a bunch of data > munging scripts from Perl to Python. I know that there are several port > services for OS X (fink, darwin ports, opendarwin). So I am not sure > whether to use their port of Python or whether to build from

Re: Python editor

2006-08-24 Thread Larry Bates
Jason Jiang wrote: > Hi, > > Could someone recommend a good Python editor? Thanks. > > Jason > > > For just getting started use Idle that comes with Python. If you are already a user or if you are looking for a more powerful solution you can use Eclipse (with Python plug-in). These represent

Re: When is a subclass not right?

2006-08-24 Thread Rick Zantow
Gabriel Genellina <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > At Thursday 24/8/2006 17:44, Chaz Ginger wrote: > >>That is merely a logical use of OO after all when would a car and an >>orange be the same? > > Uh... what's the point...? > By example, an orange inside a car would be mo

OS X and Python - what is your install strategy?

2006-08-24 Thread metaperl
I'm about to get a new OS X box on which I will rewrite a bunch of data munging scripts from Perl to Python. I know that there are several port services for OS X (fink, darwin ports, opendarwin). So I am not sure whether to use their port of Python or whether to build from scratch or use the Python

Re: Python editor

2006-08-24 Thread Simon Forman
Jason Jiang wrote: > Hi, > > Could someone recommend a good Python editor? Thanks. > > Jason There have just been one or two long-ish threads on exactly this question. Search the google groups version of this group for them. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Python editor

2006-08-24 Thread Jason Jiang
Hi, Could someone recommend a good Python editor? Thanks. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-24 Thread Paul Rubin
Fredrik Lundh <[EMAIL PROTECTED]> writes: > "join" doesn't use __add__ at all, so I'm not sure in what sense that > would be more predictable. I'm probably missing something, but I > cannot think of any core method that uses a radically different > algorithm based on the *type* of one argument. 3

Re: List problem

2006-08-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > For example i write the following code in the Python command line; > list = ['One,Two,Three,Four'] > > Then enter this command, which will then return the following; > > ['One,Two,Three,Four'] > > > Now the problem, reading through the Python tutorial's, it des

Re: Record Audio Analysis

2006-08-24 Thread Jeffrey Barish
Frank LaFond wrote: > Jo Chase wrote: >> I would like to record audio from a mic and perform some basic analysis >> on >> the audio wave patterns produced. What would be the easiest way to >> accomplish this in Python? > > Take a look at http://pymedia.org > > I think it allows the features you

List problem

2006-08-24 Thread kevndcks
For example i write the following code in the Python command line; >>>list = ['One,Two,Three,Four'] Then enter this command, which will then return the following; ['One,Two,Three,Four'] Now the problem, reading through the Python tutorial's, it describe's that list's can sliced, concatenated a

Re: When is a subclass not right?

2006-08-24 Thread Gabriel Genellina
At Thursday 24/8/2006 17:44, Chaz Ginger wrote: >> I was writing some code that used someone else class as a subclass. He >> wrote me to tell me that using his class as a subclass was incorrect. I >> am wondering under what conditions, if ever, does a class using a >> subclass not work. >> >> cl

Re: Python & chess

2006-08-24 Thread Paul Boddie
Will McGugan wrote: > > I have written a chess module that may be of use to you. > > http://www.willmcgugan.com/2006/06/18/chesspy/ See also ChessBoard - a nice implementation of chess using pygame: http://www.pygame.org/projects/9/282/ Paul -- http://mail.python.org/mailman/listinfo/python-li

Re: wxPython default radiobox choice

2006-08-24 Thread Laszlo Nagy
crystalattice írta: > In my GUI app, I have a radio box allowing the user to pick his/her > gender. When I click a button, I'd like the radio box to tell the > program which choice is marked. I can get it to work when I manually > pick a choice but I get an error when the choice is left at the de

Re: Is there an elegant way to dir() module from inside?

2006-08-24 Thread volcano
Sion Arrowsmith wrote: > volcano <[EMAIL PROTECTED]> wrote: > >I am looking for a way to discover which classes a module contains from > >"inside". I am building a testing class that should, when instatntiated > >within any module, locate certain classes within the containing module. > > globals()

Re: Python & chess

2006-08-24 Thread tobiah
> Hmmm. I think that if you need to write a very clever chess game, then > you need to use very fast routines, written in C or even assembly. Oh, right. Speed. I thought that you were talking about some mismatch of capabilities. Toby -- Posted via a free Usenet account from http://www.teran

Re: When is a subclass not right?

2006-08-24 Thread Chaz Ginger
Gabriel Genellina wrote: > At Thursday 24/8/2006 16:23, Chaz Ginger wrote: > >> I was writing some code that used someone else class as a subclass. He >> wrote me to tell me that using his class as a subclass was incorrect. I >> am wondering under what conditions, if ever, does a class using a >>

Re: When is a subclass not right?

2006-08-24 Thread Chaz Ginger
Fredrik Lundh wrote: > please don't hit reply to arbitrary messages when you're posting new > messages; it messes up the message threading. > > Chaz Ginger wrote: > >> I was writing some code that used someone else class as a subclass. He >> wrote me to tell me that using his class as a subclass

Re: String formatting with nested dictionaries

2006-08-24 Thread Maric Michaud
Le jeudi 24 août 2006 21:02, Fredrik Lundh a écrit : > class wrapper: >      def __init__(self, dict): > self.dict = dict >      def __getitem__(self, key): > try: >    return self.dict[key] > except KeyError: >     Quite the same idea, but without eval and the

Re: can't destroy a wxMiniFrame

2006-08-24 Thread Flavio
It was human error... I found the bug... thanks, Laszlo Nagy wrote: > Flavio írta: > > Hi, > > > > I have a miniframe composed mainly of combo boxes, that I need to > > destroy and recreate multiple time with different choice lists for the > > combo boxes. > > > > My problem is that even after

signal - no update 'til I move the mouse

2006-08-24 Thread Sorin Schwimmer
Hi, My project needs to allow some inter-process communication. That one is solved, and when an answer is sent, it goes to its destination via a signal. Then, the Tkinter screen needs to be updated, so the user can take the next action. On my laptop it works instantly, on my desktop, only after I

Re: When is a subclass not right?

2006-08-24 Thread Gabriel Genellina
At Thursday 24/8/2006 16:23, Chaz Ginger wrote: I was writing some code that used someone else class as a subclass. He wrote me to tell me that using his class as a subclass was incorrect. I am wondering under what conditions, if ever, does a class using a subclass not work. class B1(A); def

wxPython default radiobox choice

2006-08-24 Thread crystalattice
In my GUI app, I have a radio box allowing the user to pick his/her gender. When I click a button, I'd like the radio box to tell the program which choice is marked. I can get it to work when I manually pick a choice but I get an error when the choice is left at the default value, which is "Male"

Is this a good idea or a waste of time?

2006-08-24 Thread asincero
Would it be considered good form to begin every method or function with a bunch of asserts checking to see if the parameters are of the correct type (in addition to seeing if they meet other kinds of precondition constraints)? Like: def foo(a, b, c, d): assert type(a) == str ass

Re: Is this a good idea or a waste of time?

2006-08-24 Thread skip
Arcadio> Would it be considered good form to begin every method or Arcadio> function with a bunch of asserts checking to see if the Arcadio> parameters are of the correct type (in addition to seeing if Arcadio> they meet other kinds of precondition constraints)? If it works for y

Re: wxPython default radiobox choice

2006-08-24 Thread crystalattice
Laszlo Nagy wrote: > crystalattice írta: > > In my GUI app, I have a radio box allowing the user to pick his/her > > gender. When I click a button, I'd like the radio box to tell the > > program which choice is marked. I can get it to work when I manually > > pick a choice but I get an error whe

Re: When is a subclass not right?

2006-08-24 Thread Carl Banks
Chaz Ginger wrote: > I was writing some code that used someone else class as a subclass. He > wrote me to tell me that using his class as a subclass was incorrect. I > am wondering under what conditions, if ever, does a class using a > subclass not work. [snip] > He said I should use it this way:

Re: Python & chess

2006-08-24 Thread Laszlo Nagy
tobiah írta: > Paolo Pantaleo wrote: > >> Well Python is not a good language for writing a chess engine >> > > I'm curious; how does python fall short here, and what are the > features that make some other language more suitable for the > task? > Hmmm. I think that if you need to write

Re: Python & chess

2006-08-24 Thread Will McGugan
Paolo Pantaleo wrote: > Well Python is not a good language for writing a chess engine (even if > a chess engine exists: > http://www.kolumbus.fi/jyrki.alakuijala/pychess.html), but it could be > grat for chess interfaces, for drawing boards, and similar things. I > foudn out a library for these thi

Re: When is a subclass not right?

2006-08-24 Thread Simon Forman
Chaz Ginger wrote: > I was writing some code that used someone else class as a subclass. He > wrote me to tell me that using his class as a subclass was incorrect. I > am wondering under what conditions, if ever, does a class using a > subclass not work. > > Here is an example. For instance the ori

Re: Is this a good idea or a waste of time?

2006-08-24 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, asincero wrote: > def foo(a, b, c, d): >assert type(a) == str >assert type(b) == str >assert type(c) == int >assert type(d) == bool ># rest of function follows > > This is something I miss from working with more stricter language

Re: blindness and top vs. bottom posting

2006-08-24 Thread Ben Finney
Tim Chase <[EMAIL PROTECTED]> writes: > > I am a member of another list that has at least one member who has > > lost his vision, and reads his news with a speech generator. It > > is terribly inconvenient for him to follow a thread full of > > 'bottom postings', as he is then forced to sit throu

Re: When is a subclass not right?

2006-08-24 Thread Fredrik Lundh
please don't hit reply to arbitrary messages when you're posting new messages; it messes up the message threading. Chaz Ginger wrote: > I was writing some code that used someone else class as a subclass. He > wrote me to tell me that using his class as a subclass was incorrect. I > am wondering

Re: Python and STL efficiency

2006-08-24 Thread Neil Cerutti
On 2006-08-24, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Licheng Fang wrote: >> Hi, I'm learning STL and I wrote some simple code to compare the >> efficiency of python and STL. >> >> //C++ >> #include >> #include >> #include >> #include >> #include >> using namespace std; >> >> int mai

Re: Why can't I subclass off of "date" ?

2006-08-24 Thread davidfinance
Wow, you guys are fast. Thanks Georg and Fredrik!! Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Ok, maybe this is a stupid question, but why can't I make a subclass of > > datetime.date and override the __init__ method? > > __init__ controls initialization of an already constructed objec

When is a subclass not right?

2006-08-24 Thread Chaz Ginger
I was writing some code that used someone else class as a subclass. He wrote me to tell me that using his class as a subclass was incorrect. I am wondering under what conditions, if ever, does a class using a subclass not work. Here is an example. For instance the original class might look like

Re: blindness and top vs. bottom posting (was "all ip addresses of machines in the local network")

2006-08-24 Thread Tim Chase
> I am a member of another list that has at least one member > who has lost his vision, and reads his news with a speech > generator. It is terribly inconvenient for him to follow > a thread full of 'bottom postings', as he is then forced to > sit through the previous message contents again and ag

Re: callable to disappear?

2006-08-24 Thread Fredrik Lundh
Terry Reedy wrote: > 1. You cannot know for sure until you call and get a return. with that argument, you might as well remove functions and methods from the language. after all, anything can happen when you call a function. not to mention what import can do. scary. -- http://mail.python.

Re: all ip addresses of machines in the local network

2006-08-24 Thread John Bokma
tobiah <[EMAIL PROTECTED]> wrote: > I am a member of another list that has at least one member > who has lost his vision, and reads his news with a speech > generator. It is terribly inconvenient for him to follow > a thread full of 'bottom postings', as he is then forced to > sit through the pre

Re: telnetlib thread-safe?

2006-08-24 Thread Fredrik Lundh
Jerry wrote: >> define thread-safe. how do you plan to use it? > > I would like to write a program that spawns ~10 threads. Each thread > would get a host to connect to from a Queue object and run then do it's > thing (i.e. connecting to the host, running some commands, returning > back a succe

[ANN]Py++ 0.8.1

2006-08-24 Thread Roman Yakovenko
I'm glad to announce the new version of Py++. Download page: http://language-binding.net/pyplusplus/download.html What is it? Py++ is an object-oriented framework for creating a code generator for Boost.Python library. Project home page: http://language-binding.net/pyplusplus/pyplusplus.html Ch

Re: Taking data from a text file to parse html page

2006-08-24 Thread Anthra Norell
You may also want to look at this stream editor: http://cheeseshop.python.org/pypi/SE/2.2%20beta It allows multiple replacements in a definition format of utmost simplicity: >>> your_example = ''' "Python has been an important part of Google since the beginning, and remains so as the system grow

Re: String formatting with nested dictionaries

2006-08-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I've got a bit of code which has a dictionary nested within another > dictionary. I'm trying to print out specific values from the inner > dict in a formatted string and I'm running into a roadblock. I can't > figure out how to get a value from the inner dict into the

Re: What do you want in a new web framework?

2006-08-24 Thread olsongt
Peter Maas wrote: > Alex Martelli wrote: > > Indeed, it has been truthfully observed that Python's the only language > > with more web frameworks than keywords. > > > > I have already suggested to the BDFL that he can remedy this situation > > in Py3k: all he has to do, of course, is to add a LOT

Re: Python & chess

2006-08-24 Thread tobiah
Paolo Pantaleo wrote: > Well Python is not a good language for writing a chess engine I'm curious; how does python fall short here, and what are the features that make some other language more suitable for the task? Toby -- Posted via a free Usenet account from http://www.teranews.com -- htt

Re: all ip addresses of machines in the local network

2006-08-24 Thread tobiah
I am a member of another list that has at least one member who has lost his vision, and reads his news with a speech generator. It is terribly inconvenient for him to follow a thread full of 'bottom postings', as he is then forced to sit through the previous message contents again and again in sea

Re: Why can't I subclass off of "date" ?

2006-08-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Ok, maybe this is a stupid question, but why can't I make a subclass of > datetime.date and override the __init__ method? __init__ controls initialization of an already constructed object. to control construction, you need to override __new__: http://pyref.infog

Re: Why can't I subclass off of "date" ?

2006-08-24 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Ok, maybe this is a stupid question, but why can't I make a subclass of > datetime.date and override the __init__ method? > > --- > > from datetime import date > > class A(date): > def __init__(self, a, b, c, d): > print a, b, c, d > date.__init__(s

Re: Python and STL efficiency

2006-08-24 Thread JSprenkle
Licheng Fang wrote: > Hi, I'm learning STL and I wrote some simple code to compare the > efficiency of python and STL. > > //C++ > #include > #include > #include > #include > #include > using namespace std; > > int main(){ > vector a; > for (long int i=0; i<1 ; ++i){ >

Re: setuid root

2006-08-24 Thread Tiago Batista
On Thu, 24 Aug 2006 17:48:26 +0200 Patrick Useldinger <[EMAIL PROTECTED]> wrote: > Tiago Simões Batista wrote: > > The sysadmin already set the setuid bit on the script, but it > > still fails when it tries to write to any file that only root has > > write access to. > > use sudo. > -- > http://

Re: Python Syntax Highlighting Module

2006-08-24 Thread Cliff Wells
On Mon, 2006-08-21 at 08:19 -0700, gene tani wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > I have an idea for a project which involves an editor that supports > > syntax highlighting. This would be for any language, particularly php, > > html, css, etc. I would like to write this program using

Re: [wxPython-users] [ANN]UliPad 3.3 is released

2006-08-24 Thread Mario Lacunza
Sorry, I correct me:Your link in the message not found, but the link in the web site work Ok.Thanks!2006/8/24, Mario Lacunza <[EMAIL PROTECTED] >:Hi,Is possible then you correct the path for download the sources Zip file?? I want to test this tool but I dont could donwload it...Thansk!2006/8/23, l

Why can't I subclass off of "date" ?

2006-08-24 Thread davidfinance
Ok, maybe this is a stupid question, but why can't I make a subclass of datetime.date and override the __init__ method? --- from datetime import date class A(date): def __init__(self, a, b, c, d): print a, b, c, d date.__init__(self, 2006, 12, 11) d = A(1, 2, 3, 4) --- $ p

Re: [wxPython-users] [ANN]UliPad 3.3 is released

2006-08-24 Thread Mario Lacunza
Hi,Is possible then you correct the path for download the sources Zip file?? I want to test this tool but I dont could donwload it...Thansk!2006/8/23, limodou < [EMAIL PROTECTED]>:What's it? It's an Editor based on wxPython. NewEdit is the old name, and UliPadis the new name. UliPad uses Mi

Re: telnetlib thread-safe?

2006-08-24 Thread Diez B. Roggisch
Jerry schrieb: > Fredrik Lundh wrote: >> define thread-safe. how do you plan to use it? > > I would like to write a program that spawns ~10 threads. Each thread > would get a host to connect to from a Queue object and run then do it's > thing (i.e. connecting to the host, running some commands,

[ANN]pygccxml 0.8.1

2006-08-24 Thread Roman Yakovenko
I'm glad to announce the new version of pygccxml is available. Download page: http://www.language-binding.net/pygccxml/download.html What is it? "...The purpose of the GCC-XML extension is to generate an XML description of a C++ program from GCC's internal representation. Since XML is easy to p

Re: can't destroy a wxMiniFrame

2006-08-24 Thread Laszlo Nagy
Flavio írta: > Hi, > > I have a miniframe composed mainly of combo boxes, that I need to > destroy and recreate multiple time with different choice lists for the > combo boxes. > > My problem is that even after destroying a miniframe with the Destroy() > method, when it is recreated, the combo boxe

can't destroy a wxMiniFrame

2006-08-24 Thread Flavio
Hi, I have a miniframe composed mainly of combo boxes, that I need to destroy and recreate multiple time with different choice lists for the combo boxes. My problem is that even after destroying a miniframe with the Destroy() method, when it is recreated, the combo boxes show the same lists of it

Re: What do you want in a new web framework?

2006-08-24 Thread Cliff Wells
On Thu, 2006-08-24 at 04:28 -0700, Paul Boddie wrote: > Cliff Wells wrote: > > On Thu, 2006-08-24 at 04:04 +, Tim Roberts wrote: > > > Cliff Wells <[EMAIL PROTECTED]> wrote: > > > > > > > >But there are interesting things in Ruby (and Ruby 2 should take care of > > > >lots of warts Ruby 1.8 has

Python & chess

2006-08-24 Thread Paolo Pantaleo
Well Python is not a good language for writing a chess engine (even if a chess engine exists: http://www.kolumbus.fi/jyrki.alakuijala/pychess.html), but it could be grat for chess interfaces, for drawing boards, and similar things. I foudn out a library for these things (http://www.alcyone.com/soft

Re: telnetlib thread-safe?

2006-08-24 Thread Jerry
Fredrik Lundh wrote: > define thread-safe. how do you plan to use it? I would like to write a program that spawns ~10 threads. Each thread would get a host to connect to from a Queue object and run then do it's thing (i.e. connecting to the host, running some commands, returning back a success o

  1   2   >