Re: question about True values

2006-10-27 Thread Steven D'Aprano
On Sat, 28 Oct 2006 03:13:42 +0100, Steve Holden wrote: >> Python is not evaluating the truth of the matter, but, as Ms. Creighton >> would say, the "somethingness" of that which 10 > 5 evaluates to. (1 >> aka True) >> > >>> type(10>5) > > >>> > > It does seem that there is a specific t

Re: PyQt-x11-gpl-3.16 compile error

2006-10-27 Thread baur79
Hi David here is th output : [EMAIL PROTECTED] PyQt-x11-gpl-3.16]# python configure.py -q /usr/lib/qt-3.3/ -w This is the GPL version of PyQt 3.16 (licensed under the GNU General Public License) for Python 2.4.2 on linux2. Type 'L' to view the license. Type 'yes' to accept the terms of the licens

Re: using mmap on large (> 2 Gig) files

2006-10-27 Thread [EMAIL PROTECTED]
Martin v. Löwis wrote: > sturlamolden schrieb: > > > And why doesn't Python's mmap take an offset argument to handle large > > files? > > I don't know exactly; the most likely reason is that nobody has > contributed code to make it support that. That's, in turn, probably > because nobody had the pr

Re: compiling on AIX 5.3 with vacpp

2006-10-27 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I am trying to compile Python 2.5 on AIX 5.3. I used > > building '_locale' extension > ./Modules/ld_so_aix xlc_r -q64 -bI:Modules/python.exp > build/temp.aix-5.3-2.5/home/pxadm/.test/Python-2.5/Modules/_localemodule.o > -L/usr/local/lib -o build/lib.aix-5.3-2.5/_locale.s

Re: How the event list be sent to EventManager?

2006-10-27 Thread steve
Thank you,Fredrik,I see. Fredrik Lundh wrote: > steve wrote: > > > Can an argument to reference an object's attribute?? > > sorry, cannot parse that sentence. > > the arguments to a method are objects, and objects have attributes. why > do you find this surprising? > > -- http://mail.python.o

Re: "Music Theory Programming" Google Group

2006-10-27 Thread Omar
see you over there! -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 23:13, Steve Holden wrote: J. Clifford Dyer wrote: > the one thing that Ms. Creighton points out that I can't get past is > that Python, even with its bool type, *still* evaluates somethingness > and nothingness, and True and False are just numbers with hats on. > > >>> Tru

Re: question about True values

2006-10-27 Thread Steve Holden
J. Clifford Dyer wrote: > I do see how mapping to Truth/Falsehood is more natural, and I do > believe that one of the great things about python is that it feels > natural in so many ways, and hence makes it easy to produce code, but > the one thing that Ms. Creighton points out that I can't get

Re: Sentinel values for special cases

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 21:09, Ben Finney wrote: > > >GLOBAL = object() > > > > > >def insert_ids(ids=GLOBAL): > > >if ids is GLOBAL: > > >ids = get_global_ids() > > > >The one disadvantage of this approach is that it complicates > >pickling if/when you store the stentin

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi, > > I am new to python and am currently writing my first application. One > of the problems I quickly ran into, however, is that python's imports > are very different from php/C++ includes in the sense that they > completely wrap the imported script in a module obj

Test-driven development (was: Tracing the execution of scripts?)

2006-10-27 Thread Ben Finney
"Michael B. Trausch" writes: > Ben Finney wrote: > > Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > > > >> 1) Write unit tests for your code. Keep writing unit tests until > >> you have some that _don't pass_. Then fix your code so that they > >> do. When you do further development, write

Re: Ctypes Error: Why can't it find the DLL.

2006-10-27 Thread Mudcat
That was it. Once I added the other DLLs then it was able to find and make the call. Thanks for all the help, Marc Bruno Desthuilliers wrote: > Mudcat a écrit : > > Hi, > > > > I can't figure out why ctypes won't load the DLL I need to use. I've > > tried everything I can find (and the ctypes we

Re: Cards deck problem

2006-10-27 Thread Ben Finney
Gabriel Genellina <[EMAIL PROTECTED]> writes: > At Friday 27/10/2006 00:48, Michael Naunton wrote: > > >As noted in the problem, a deck has 52 cards. cardsLeft(self) > >therefore always returns 52. > > Uhm, maybe it's a matter of language, but how do you name the pile of > cards remaining to be d

Re: Sentinel values for special cases

2006-10-27 Thread Ben Finney
Gabriel Genellina <[EMAIL PROTECTED]> writes: > At Friday 27/10/2006 11:40, Aahz wrote: > > Ben Finney wrote: > > >GLOBAL = object() > > > > > >def insert_ids(ids=GLOBAL): > > >if ids is GLOBAL: > > >ids = get_global_ids() > > > >The one disadvantage of this approach is

Re: Sentinel values for special cases

2006-10-27 Thread Ben Finney
[EMAIL PROTECTED] (Aahz) writes: > Ben Finney <[EMAIL PROTECTED]> wrote: > >Use a unique do-nothing object, defined at the module level so > >callers can easily get at it [...] > > > >GLOBAL = object() > > > >def insert_ids(ids=GLOBAL): > >if ids is GLOBAL: > >ids = ge

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 19:48, [EMAIL PROTECTED] wrote: Wouldn't importing and re-importing the same modules cause considerable resource bulk? Or does python cache that stuff? No. Once a module is imported by the first time, the module object is placed in sys.modules; if a subsequent import find

Re: Handling emails

2006-10-27 Thread Ben Finney
Fulvio <[EMAIL PROTECTED]> writes: > On Friday 27 October 2006 06:48, Ben Finney wrote: > > There is always the option to not send messages to this list using > > that mail server > > Once again sorry for that. I'll take action to switch to another > mailserver. Thank for the advice That would b

Re: question about True values

2006-10-27 Thread J. Clifford Dyer
I do see how mapping to Truth/Falsehood is more natural, and I do believe that one of the great things about python is that it feels natural in so many ways, and hence makes it easy to produce code, but the one thing that Ms. Creighton points out that I can't get past is that Python, even with

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-27 Thread Farshid Lashkari
[EMAIL PROTECTED] wrote: > Wouldn't importing and re-importing the same modules cause considerable > resource bulk? Or does python cache that stuff? If a module is already imported, then the import statement just uses the cached module. However, you can force a full reload of the module using th

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-27 Thread noamsml
Wouldn't importing and re-importing the same modules cause considerable resource bulk? Or does python cache that stuff? On Oct 27, 6:28 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Friday 27/10/2006 18:53, [EMAIL PROTECTED] wrote: > > >I am new to python and am currently writing my first

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 18:53, [EMAIL PROTECTED] wrote: I am new to python and am currently writing my first application. One of the problems I quickly ran into, however, is that python's imports are very different from php/C++ includes in the sense that they completely wrap the imported script in

Re: Cards deck problem

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 00:48, Michael Naunton wrote: It is clear your professor does not understand computer science. Switch to a new university now. As noted in the problem, a deck has 52 cards. cardsLeft(self) therefore always returns 52. This may seem pendantic, but CS is mostly about think

Re: "Music Theory Programming" Google Group

2006-10-27 Thread [EMAIL PROTECTED]
That sounds cool to me.. I am looking for a way to save(self) (csound routines).. and I saw your background in religion :) so I will head on over there https://sourceforge.net/project/showfiles.php?group_id=156455 Omar wrote: > I've been learning some programming during my little sabbatical (m

Re: question about True values

2006-10-27 Thread Slawomir Nowaczyk
On Fri, 27 Oct 2006 11:25:09 -0700 Carl Banks <[EMAIL PROTECTED]> wrote: #> P.S. binary trees do have length: it's the number of nodes, just as #> the number of keys is the length of a dict. I can't think of any #> objects that use indexing but don't have a length, Well, infinite lists (either ci

What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-27 Thread noamsml
Hi, I am new to python and am currently writing my first application. One of the problems I quickly ran into, however, is that python's imports are very different from php/C++ includes in the sense that they completely wrap the imported script in a module object. One of the problems with this was

Import Error

2006-10-27 Thread Joseph
Hi, I am using Karrigell & Sprite for webdevelopment. Sprite is placed in the main folder of my app. I got a sub-folder called admin. I am using the below line to import Sprite within the subfolder. from ..sprite import Sprite Most of the time it works. However time to time, it will throw an erro

Re: How to Split Chinese Character with backslash representation?

2006-10-27 Thread J. Clifford Dyer
Paul McGuire wrote: > "Wijaya Edward" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Hi all, >> >> I was trying to split a string that >> represent chinese characters below: >> >> > str = '\xc5\xeb\xc7\xd5\xbc' > fields2 = split(r'\\',str) > > There are no backslash char

Re: python GUIs comparison (want)

2006-10-27 Thread David Boddie
On Friday 27 October 2006 16:36, Magnus Lycka wrote: > David Boddie wrote: >> You're forgetting that Qt isn't just a widget toolkit. > > I suspect that the non-GUI parts are (just like in Wx) C++ stuff > which is more or less equivalent with things that are either Python > builtins or parts of Pyt

Re: What's the best IDE?

2006-10-27 Thread Ramon Diaz-Uriarte
On 27 Oct 2006 12:14:57 -0700, Adam Jones <[EMAIL PROTECTED]> wrote: > > emacs > (...) > > It would be fine for a begginer, right? > > Probably not. I think you have to spend enough time with environments Actually, I've read similar things before and I don't quite get it. I guess all of us are

Re: How to Split Chinese Character with backslash representation?

2006-10-27 Thread jim-on-linux
On Thursday 26 October 2006 23:43, you wrote: > Hi all, > > I was trying to split a string that > > represent chinese characters below: > >>> str = '\xc5\xeb\xc7\xd5\xbc' > >>> print str2, > > ??? > > >>> fields2 = split(r'\\',str) > >>> print fields2, > > ['\xc5\xeb\xc7\xd5\xbc'] > > But why the s

Re: ANN: the pyfaq wiki has moved

2006-10-27 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >>> If you have some time to spare, why not drop by, pick some random >>> article, and let us know how it can be improved: >>> >>> http://effbot.org/random/pyfaq >> >> How do we log in to make changes? > > as with the 'infogami' version, you don't

Re: Optional Parameter Requirements

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 16:35, [EMAIL PROTECTED] wrote: If I'm building a function to accept optional parameters, do I need to allow for the capture of both the positional arguments as well as the keyword arguments? If it doesn't make sense to allow keyword arguments, can I just write: def myfunc(

Re: Sentinel values for special cases

2006-10-27 Thread Gabriel Genellina
At Friday 27/10/2006 11:40, Aahz wrote: >GLOBAL = object() > >def insert_ids(ids=GLOBAL): >if ids is GLOBAL: >ids = get_global_ids() The one disadvantage of this approach is that it complicates pickling if/when you store the stentinel in an instance. There are ways

Optional Parameter Requirements

2006-10-27 Thread [EMAIL PROTECTED]
If I'm building a function to accept optional parameters, do I need to allow for the capture of both the positional arguments as well as the keyword arguments? If it doesn't make sense to allow keyword arguments, can I just write: def myfunc(a, b, *tup): ... and be done with it? TIA -- http:

Re: More Noob Questions

2006-10-27 Thread Omar
Roberto Bonvallet wrote: > Omar wrote: > > more to come! > > Please, use a more meaningful subject next time, like "Integration of > Python and Flash" or "Where can I find vido tutorials". That way it will > be easier to people that knows about the subject to find your message and > answer you. >

Import Error

2006-10-27 Thread Joseph
Hi, I am using Karrigell & Sprite for web development. Sprite is placed in the main folder of my app. I got a sub-folder called admin. I am using the below line to import Sprite from the subfolder. from ..sprite import Sprite Most of the time it works. However time to time, it will throw an error

Re: What's the best IDE?

2006-10-27 Thread Tim Chase
>> What's your favorite IDE? > > emacs > >> What do you like about it? > > It does just about everything. It can edit just about every kind of > code I use, read my mail, connection to irc ... everything. Well, > except order pizza, but I think it might be possible to make that > happen as well.

Import Error

2006-10-27 Thread Joseph
Hi, I am using Karrigell & Sprite for web development. Sprite is placed in the main folder of my app. I got a sub-folder called admin. I am using the below line to import Sprite from the subfolder. from ..sprite import Sprite Most of the time it works. However time to time, it will throw an error

"Music Theory Programming" Google Group

2006-10-27 Thread Omar
I've been learning some programming during my little sabbatical (mostly python), and I thought it'd be cool to see if other people are interested in programming for music theory. So I started a Music Theory Programming google group. Consider yourselves invited! It'll be a place for people with d

Re: ANN: the pyfaq wiki has moved

2006-10-27 Thread Fredrik Lundh
John Salerno wrote: >> If you have some time to spare, why not drop by, pick some random >> article, and let us know how it can be improved: >> >> http://effbot.org/random/pyfaq > > How do we log in to make changes? as with the 'infogami' version, you don't -- if you find something that nee

Re: What's the best IDE?

2006-10-27 Thread Adam Jones
[EMAIL PROTECTED] wrote: > Recently I've had some problems with PythonWin when I switched to > Py2.5, tooka long hiatus, and came back. So now I'm without my god sent > helper, and I'm looking for a cool replacement, or some advocation to > reinstall/setup PyWin. But the Python website's list is i

Re: conditional computation

2006-10-27 Thread robert
> Robert, that's not the point. I do have enough Python knowledge to > understand this (totally trivial) code !-) > > What I don't understand is how this code is supposed to save you from > having to actually write both complex-key-expr and > expensive-calc-expression more than once. You need them

Re: More Noob Questions

2006-10-27 Thread Omar
thank you all for your replies -- http://mail.python.org/mailman/listinfo/python-list

Re: Tracing the execution of scripts?

2006-10-27 Thread R. Bernstein
Fulvio <[EMAIL PROTECTED]> writes: > *** > Your mail has been scanned by InterScan MSS. > *** Delighted to know that. > > On Friday 27 October 2006 17:31, R. Bernstein wrote: > > pydb (http://bashdb.sf.net/pydb) has a both the ability to trace lines > > I

Re: question about True values

2006-10-27 Thread Antoon Pardon
On 2006-10-27, Donn Cave <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Antoon Pardon <[EMAIL PROTECTED]> wrote: > ... >> I think you are incorrect. > > Thanks! I rest my case! > >> And how do I express that a number has to be greater than >> 100 into a Nothing vs Something dichot

Re: Telnetlib to twisted

2006-10-27 Thread Jean-Paul Calderone
On Fri, 27 Oct 2006 16:40:44 +0100, Matthew Warren <[EMAIL PROTECTED]> wrote: >Hallo, > import telnetlib l=telnetlib.Telnet('dbprod') l.interact() >telnet (dbprod) > >Login: > > >Could anyone show how the above would be written using the twisted >framework? All I'm after is a more 'i

Beautiful women, aged clones, and Ultimate Fighting Championship

2006-10-27 Thread baseballsoccer123
Friend, I'm always looking for good and intelligent individuals like you to visit my website, www.ChezBrandon.com , and it has pictures of beautiful women, information about aged clones, and a link to Ultimate Fighting Championship, a very good show. My name is Brandon, and I'm in my 20s, am a co

Re: How set the source IP adress

2006-10-27 Thread Grant Edwards
On 2006-10-27, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-10-27, Irmen de Jong <[EMAIL PROTECTED]> wrote: > >>> how to set source ip-address when do __socket.connect((host, port)) >>> on a machine that have a several ip-adresses? >>> >>> __socket = socket.socket(socket.AF_INET, socket.SOCK

Re: question about True values

2006-10-27 Thread Carl Banks
Steven D'Aprano wrote: > But in this specific instance, I don't see any advantage to explicitly > testing the length of a list. Antoon might think that is sufficiently > polymorphic, but it isn't. He cares whether the object has zero _length_, > but for true polymorphism, he should be caring about

Re: How set the source IP adress

2006-10-27 Thread Grant Edwards
On 2006-10-27, Irmen de Jong <[EMAIL PROTECTED]> wrote: >> how to set source ip-address when do __socket.connect((host, port)) >> on a machine that have a several ip-adresses? >> >> __socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >> __socket.connect((host, port)) > > sock.connect ( (

Re: question about True values

2006-10-27 Thread Antoon Pardon
On 2006-10-27, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 27 Oct 2006 09:16:57 +, Antoon Pardon wrote: > >>> I think it is a good time to remind people of some extremely well-thought >>> out opposition to the introduction of bools to Python from Laura Creighton: >>> >>> http://mail.py

Re: ANN: the pyfaq wiki has moved

2006-10-27 Thread John Salerno
Fredrik Lundh wrote: > If you have some time to spare, why not drop by, pick some random > article, and let us know how it can be improved: > > http://effbot.org/random/pyfaq How do we log in to make changes? -- http://mail.python.org/mailman/listinfo/python-list

Using xtopdf, a PDF creation toolkit - Creating PDF Output from Plain Text, DBF, CSV, TDV, and XLS Data

2006-10-27 Thread vasudevram
Hi, Though I posted about this article earlier, reposting it with a more appropriate title, to make it easier for searches. "Using xtopdf, a PDF creation toolkit" URL: http://www.packtpub.com/article/Using_xtopdf This is an article by me, written for Packt Publishing, about how to use my xtopdf

Re: question about True values

2006-10-27 Thread Antoon Pardon
On 2006-10-27, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > But in this specific instance, I don't see any advantage to explicitly > testing the length of a list. Antoon might think that is sufficiently > polymorphic, but it isn't. He cares whether the object has zero _length_, > but for true poly

Re: How set the source IP adress

2006-10-27 Thread Irmen de Jong
Maksim Kasimov wrote: > Hi, > > how to set source ip-address when do __socket.connect((host, port)) > on a machine that have a several ip-adresses? > > many thanks for advice. > > __socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > __socket.connect((host, port)) > > sock.connect (

Re: question about True values

2006-10-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: ... > I think you are incorrect. Thanks! I rest my case! > And how do I express that a number has to be greater than > 100 into a Nothing vs Something dichotomy? Declare all > greater numbers as Something and the rest as N

Re: Telnetlib to twisted

2006-10-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Bjoern Schliessmann wrote: >> This email is confidential and may be privileged. If you are not >> the intended recipient please notify the sender immediately and >> delete the email from your computer. > > Am I the inteded recipient? I'm not listed in the headers. This is

Re: importing class

2006-10-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, gmarkowsky wrote: > Hi all, > > I'm trying to import a class from a module. The class looks like this: > class App: > > def __init__(self, master): > > frame = Frame(master) > frame.pack() > > self.button = Button(frame, text=text_1, command=

Re: Handling emails

2006-10-27 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Friday 27 October 2006 06:48, Ben Finney wrote: > There is always the option to not send messages to this list using > that mail server Once again sorry for that. I'll take action to switch to another

importing class

2006-10-27 Thread gmarkowsky
Hi all, I'm trying to import a class from a module. The class looks like this: class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text=text_1, command= self.comm_1) self.button.pack(side=LEFT) self.h

Re: Tracing the execution of scripts?

2006-10-27 Thread fumanchu
Stephan Kuhagen wrote: > "Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> wrote: > > > Basically, is there something that will log every line of Python code > > executed, in its order of execution, to a text file so that I can see > > what is (or isn't) happening that I am expecting? > > Python

Re: How the event list be sent to EventManager?

2006-10-27 Thread Fredrik Lundh
steve wrote: > Can an argument to reference an object's attribute?? sorry, cannot parse that sentence. the arguments to a method are objects, and objects have attributes. why do you find this surprising? -- http://mail.python.org/mailman/listinfo/python-list

Re: Telnetlib to twisted

2006-10-27 Thread Bjoern Schliessmann
Matthew Warren wrote: > Could anyone show how the above would be written using the twisted > framework? All I'm after is a more 'intelligent' interactive > telnet session (handles 'vi' etc..) rather than the full > capabilities of the twisted framework. Not done this until now, but have a look at

Telnetlib to twisted

2006-10-27 Thread Matthew Warren
Hallo, >>> import telnetlib >>> l=telnetlib.Telnet('dbprod') >>> l.interact() telnet (dbprod) Login: Could anyone show how the above would be written using the twisted framework? All I'm after is a more 'intelligent' interactive telnet session (handles 'vi' etc..) rather than the full capabilit

Accessing ClarifyCRM with Python

2006-10-27 Thread Jason
I need to embed the ability to create a Clarify Case in a python program I have written. Unfortunately my familiarity with Clarify is very limited at this point. Is there a module out there that makes this process semi-painless? I couldn't find one googling around... Has anyone implemented some

Re: conditional computation

2006-10-27 Thread Bruno Desthuilliers
robert wrote: > Bruno Desthuilliers wrote: >> robert wrote: >>> Bruno Desthuilliers wrote: robert a écrit : (snip) > class MemoCache(dict): # cache expensive Objects during a session > (memory only) >def memo(self, k, f): >try: return self[k] >excep

Re: Insert characters into string based on re ?

2006-10-27 Thread guido . thelen
You can test it here: http://www.sqlinform.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PyDev + Eclipse (Was: Re: What's the best IDE?)

2006-10-27 Thread Fabio Zadrozny
On 10/26/06, Michael B. Trausch wrote: Kenneth McDonald wrote:>> With the most recent edition of PyDev, I find Eclipse works quite well > for me.>Since you mentioned it, I have a question that searching around andpoking around has not solved for me, yet.Do you have aut

Re: python GUIs comparison (want)

2006-10-27 Thread Magnus Lycka
David Boddie wrote: > You're forgetting that Qt isn't just a widget toolkit. I suspect that the non-GUI parts are (just like in Wx) C++ stuff which is more or less equivalent with things that are either Python builtins or parts of Python's standard library. Besides, getting those proprietary depen

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-27 Thread Magnus Lycka
Méta-MCI wrote: > Hi! (***sorry for my approximative english***) That's ok. Quite amusing to read that you were repaired. > A few months ago, I needed a console, under Windows. > After several research, I selected the console of EffBot. > > Thank you very much, Fredrik Lundh, for this small

Re: Configfile

2006-10-27 Thread Larry Bates
Fulvio wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > HI, > > I've a small doubt regarding the way to save a configuration file on the file > manipulated by ConfigParser. > As far as I could understand this: > > cp = ConfigParser

Re: Tracing the execution of scripts?

2006-10-27 Thread Larry Bates
I just thought I would put my 2 cents in on this issue. Others have suggested that unit tests are an excellent way of debugging your code and I agree. I also find that writing code from the outset using a logging class (there is one in the standard library) that allows you to create log files of

Re: virtual function appears in two bases

2006-10-27 Thread Fredrik Lundh
joe Li wrote: > I saw the following code, but I don't understand the rule for virtual > function that appears in two bases > Could anyone explain it for me, thanks. http://docs.python.org/tut/node11.html#SECTION001151 -- http://mail.python.org/mailman/listinfo/python-list

Re: Configfile

2006-10-27 Thread Diez B. Roggisch
Fulvio schrieb: > *** > Your mail has been scanned by InterScan MSS. > *** > > > HI, > > I've a small doubt regarding the way to save a configuration file on the file > manipulated by ConfigParser. > As far as I could understand this: > > cp = ConfigPars

Re: How the event list be sent to EventManager?

2006-10-27 Thread steve
Can an argument to reference an object's attribute?? Fredrik Lundh wrote: > steve wrote: > > > The example code from: http://sjbrown.ezide.com/games/example1.py.html > > ... > > def Notify( self, event ): > > if not isinstance(event, TickEvent): Debug( " > > Message: " + event.name

Re: PyQt-x11-gpl-3.16 compile error

2006-10-27 Thread David Boddie
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] PyQt-x11-gpl-3.16]# python configure.py -q > /usr/lib/qt-3.3/ > This is the GPL version of PyQt 3.16 (licensed under the GNU General > Public > License) for Python 2.4.2 on linux2. [...] > Creating features file... > Error: Unable to build mkfeatures u

Re: Printing Hidden Character in Python

2006-10-27 Thread Brian Mills
Fulvio wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Thursday 26 October 2006 16:43, Wijaya Edward wrote: > > How can we print out the hidden character like > > "\n", "\r" etc in Python? > > If it's meant to evidentiate then you

Re: Sentinel values for special cases

2006-10-27 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > >Fourth, if you have decided that a magic sentinel value is called for >but None is already taken for some other purpose, don't use a >string. Use a unique do-nothing object, defined at the module level so >callers can easily

Re: subprocess cwd keyword.

2006-10-27 Thread Ivan Vinogradov
On 27-Oct-06, at 2:25 AM, Leo Kislov wrote: > > Ivan Vinogradov wrote: >> ... >> >> call("core/main") works but uses .. of core for input/output. >> >> call("core/main",cwd="core") and call("main",cwd="core") both >> result in > [snip exception] > > Usually current directory is not in the PATH o

Re: ANN: wxPython 2.7.1.3

2006-10-27 Thread Johann C. Rocholl
Hi Robin, You may want to use a spell checker for announcements and for the wxpython.org website. For example, the first paragraph of your announcement contains the words "plust" and "pacakges", and the word "pacakge" can also be found on the following pages: www.wxpython.org/download.php www.wxp

Re: Tracing the execution of scripts?

2006-10-27 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Friday 27 October 2006 17:31, R. Bernstein wrote: > pydb (http://bashdb.sf.net/pydb) has a both the ability to trace lines I faced several time that pydb stuck without sign of errors. In the other han

Re: Assertion failure on hotshot.stats.load()

2006-10-27 Thread skip
Yang> Note: I realize hotshot is obsoleted by cProfile, but 2.5 breaks Yang> several packages I depend on. I'm using Python 2.4.3. Not a direct answer to your question, but the cProfile module runs just fine under 2.4. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Search & Replace

2006-10-27 Thread DataSmash
Really appreciate all the all the different answers and learning tips! -- http://mail.python.org/mailman/listinfo/python-list

Test

2006-10-27 Thread Lad
Test -- http://mail.python.org/mailman/listinfo/python-list

Re: Assertion failure on hotshot.stats.load()

2006-10-27 Thread Yang
I created a simple test case showing the zope.interface problem. Just pass the following file to profile.py (i.e. the 'profile' module in your Python standard library, run as a standalone app). The culprit *seems* to be Twisted. Any ideas? Thanks in advance. #!/usr/bin/env python """ error i get:

Re: conditional computation

2006-10-27 Thread robert
Bruno Desthuilliers wrote: > robert wrote: >> Bruno Desthuilliers wrote: >>> robert a écrit : >>> (snip) class MemoCache(dict): # cache expensive Objects during a session (memory only) def memo(self, k, f): try: return self[k] except KeyError:#<

Re: Restricting import file lookup for pyd, dll, ...

2006-10-27 Thread Magnus Lycka
Bernard Lebel wrote: > Hi, > > That's because I'm using Python through another application, via the > pywin32 extensions. When that other application starts, it performs > several thousands of file requests (we're talking 4,500, roughly) in > the Python installation, locations where there are Pyth

Re: print dos format file into unix format

2006-10-27 Thread Magnus Lycka
Tim Roberts wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> Suppose I have a dos format text file. The following python code will >> print ^M at the end. I'm wondering how to print it in unix format. >> >> fh = open(options.filename) >> for line in fh.readlines() >> print line, > > Are

Re: question about True values

2006-10-27 Thread Steven D'Aprano
On Fri, 27 Oct 2006 12:54:35 +0100, Steve Holden wrote: > Antoon Pardon wrote: >> On 2006-10-27, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> >>>Antoon Pardon wrote: >>> >>> >since you never publish any code, This is not True. You shouldn't confuse your lack of recollection with r

Configfile

2006-10-27 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** HI, I've a small doubt regarding the way to save a configuration file on the file manipulated by ConfigParser. As far as I could understand this: cp = ConfigParser.ConfigParser cp.set(section,option)

Re: Printing Hidden Character in Python

2006-10-27 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Thursday 26 October 2006 16:43, Wijaya Edward wrote: > How can we print out the hidden character like > "\n", "\r" etc in Python? If it's meant to evidentiate then you should scan each byte an print i

Re: question about True values

2006-10-27 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Thursday 26 October 2006 02:56, John Salerno wrote: >  >>> s = 'hello' >  >>> s == True > False >  >>> if s: > print 'hi' > this isn't only a python behavior. the  "if" test is valid for all no

To Kill a Process that is Accepting Connection on Socket

2006-10-27 Thread mumebuhi
I removed my previous post about this topic because I apparently have pasted the wrong code. Sorry for the confusion and thanks for being patient. I am having problem to kill the following script completely. The script basically does the following. The main thread creates a new thread, which does

[Fwd: Using cElementTree and elementtree.ElementInclude]

2006-10-27 Thread Mark
Original Message Subject: Using cElementTree and elementtree.ElementInclude Date: Mon, 23 Oct 2006 09:40:24 -0500 From: Mark E. Smith <[EMAIL PROTECTED]> Organization: AEDC To: python-list@python.org > cElementTree cannot hold ElementTree instances. > > can you post a small but

Re: PyDev + Eclipse (Was: Re: What's the best IDE?)

2006-10-27 Thread Éric Daigneault
olive wrote: > > Michael B. Trausch wrote: > > > >> >> Yep. Still does it. >> > > > > I'm running PyDev 1.2.4 without completion problem so far. > > > > Are you up to date ? > > > > Maybe you should install the latest from scratch. > > > > >Yep, I am up to date. As I said, I am t

Re: Insert Content of a File into a Variable

2006-10-27 Thread Paul McGuire
"Wijaya Edward" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi, > > How can we slurp all content of a single file > into one variable? > Please don't double-post your questions. Now you have two threads running with people answering the same question. -- Paul -- http://m

Re: NumPy 1.0 release

2006-10-27 Thread sturlamolden
Travis E. Oliphant wrote: > We are very pleased to announce the release of NumPy 1.0 available for > download at http://www.numpy.org Congratulations to you and the other NumPy developers for completing this major undertaking. I would also like to express my sincere gratitude for making this mak

Re: Slurping All Content of a File into a Variable

2006-10-27 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > myfile_content is an object and you have only opened the file. Python > doesn't yet know whether you want to read it, copy it etc. > > to read it try > > text = myfile_content.readlines() > print text > > this should be in most tutoria

Re: How to Split Chinese Character with backslash representation?

2006-10-27 Thread Paul McGuire
"Wijaya Edward" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi all, > > I was trying to split a string that > represent chinese characters below: > > str = '\xc5\xeb\xc7\xd5\xbc' print str2, > ??? fields2 = split(r'\\',str) print fields2, > ['\xc5\xeb\xc7\xd

Re: PyDev + Eclipse (Was: Re: What's the best IDE?)

2006-10-27 Thread Michael B. Trausch
olive wrote: > Michael B. Trausch wrote: > >> Yep. Still does it. > > I'm running PyDev 1.2.4 without completion problem so far. > > Are you up to date ? > > Maybe you should install the latest from scratch. > Yep, I am up to date. As I said, I am totally confused. -- Mike -- http

  1   2   >