Re: Codec Search Function

2006-01-26 Thread Fredrik Lundh
James Stroud wrote: > How do I get the SVN version? Maybe that is not the one I have. This > crashes on the version I have (complete program listing): > > "abcde".encode('hex') > > LookupError: no codec search functions registered: can't find encoding > I am using the latest enthought python

Re: any way to customize the is operator?

2006-01-26 Thread Lonnie Princehouse
> (objects are not allowed to lie about who they are, or what they are). Dangit! I need to find a less honest programming language. Anyone have a Perl cookbook handy? ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Mining strings from a HTML document.

2006-01-26 Thread Derick van Niekerk
Thanks Guys! I've written several functions yesterday to import from different types of raw data including html and different text formats. In the end I never used the extract function or the parser module, but your advice put me on the right track. All these functions are now in a single object a

Re: any way to customize the is operator?

2006-01-26 Thread Fredrik Lundh
Lonnie Princehouse wrote: > There doesn't seem to be any way to customize the behavior of "is" as > can be done for other operators... why not? because it does "id(a) == id(b)", and there's no way to customize the behaviour of id(). (objects are not allowed to lie about who they are, or what the

ANN: HTMLTestRunner - generates HTML test report for unittest

2006-01-26 Thread aurora
Greeting, HTMLTestRunner is an extension to the Python standard library's unittest module. It generates easy to use HTML test reports. See a sample report at http://tungwaiyip.info/software/sample_test_report.html. Check more information and download from http://tungwaiyip.info/software/#html

Re: Running a DOS exe file from python

2006-01-26 Thread Rinzwind
Hello, Something like this: progname = 'c:\tmp\myprog.exe arg1 '+'-- help' os.system(r'progname) should work too. So you should be able to change progname to any location you need to start it and all the args to whatever is needed. -- http://mail.python.org/mailman/listinfo/python-list

any way to customize the is operator?

2006-01-26 Thread Lonnie Princehouse
There doesn't seem to be any way to customize the behavior of "is" as can be done for other operators... why not? -- http://mail.python.org/mailman/listinfo/python-list

Re: sockets programming with python on mobile phones

2006-01-26 Thread al pacino
Thanks ! well..acutally this is siddharth dave i am a BIG al pacino fan ..(and before joning this grp i had just watched 'scent of a woman") hence this pun on myself!! neways thanks for replying ps: dear edwards watch 'scent of a woman' and u will forget 'doniie brosco'..:-) AL pacino won an osca

"Intro to Pyparsing" Article at ONLamp

2006-01-26 Thread Paul McGuire
I just published my first article on ONLamp, a beginner's walkthrough for pyparsing. Please check it out at http://www.onlamp.com/pub/a/python/2006/01/26/pyparsing.html, and be sure to post any questions or comments. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: [IDE] - The Dynamic Opportunity - ActiveState Komodo IDE / Open Source

2006-01-26 Thread Ed Leafe
On Jan 26, 2006, at 6:37 PM, Ilias Lazaridis wrote: > As a first step, a free personal edition (non-commercial and academic > use) would help to spread the Komodo IDE within the communities. > > This would be a gentle contribution to the open source dynamic > languages, which are a foundation for

Re: obtain client ip address from SimpleXMLRPCServer ?

2006-01-26 Thread stuff
Thanks for the reply Peter. Can you provide a code snippet for extracting this data. When I print the dir() of the SimpleXMLRPCServer instance I do not see a request_handler attribute or method. Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expressions, unicode and XML

2006-01-26 Thread ProvoWallis
Thanks for this but I'm still getting an "empty" character (I don't know what else to call it) rather than the text captured by my regular expression in my replaced text. I even added the utf encoding declaration to my input data but still no luck. Any suggestions? -- http://mail.python.org/mai

Re: generating method names 'dynamically'

2006-01-26 Thread Peter Hansen
Daniel Nogradi wrote: > Well, I would normally do what you suggest, using parameters, but in > the example at hand I have to have the method names as variables and > the reason is that the whole thing will be run by apache using > mod_python and the publisher handler. There a URL > http://something

Re: beta.python.org content

2006-01-26 Thread Shalabh Chaturvedi
Steve Holden wrote: > How does > >http://beta.python.org/about/beginners/ > > look? > Steve, This is a great writeup. Here are my comments: 1. "Fortunately Python is something that an experienced programmer of another language (be it ..." Add C# and/or Java to this list. The current li

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Alex Martelli
Christoph Conrad <[EMAIL PROTECTED]> wrote: > Hallo Alex, > > >> r = re.compile("[^a]*a{3}b+(a+b*)*") matches = [s for s in > >> listOfStringsToTest if r.match(s)] > > > Unfortunately, the OP's spec is even more complex than this, if we are > > to take to the letter what you just quoted; e.g. aa

Re: Strange behavior of int()

2006-01-26 Thread Dan Sommers
On 26 Jan 2006 18:42:34 -0800, "Brian" <[EMAIL PROTECTED]> wrote: > If I execute a similar command from the command line, it works just > fine: int(0.05/0.05) > 1 Try this: >>> print 2.3 - int(2.3/.25)*.25 0.05 >>> 2.3 - int(2.3/.25)*.25 0.049822 Then check out

Strange behavior of int()

2006-01-26 Thread Brian
Hello, Can someone tell me what I am doing wrong in this code. If I create a file change.py with the following contents: def intTest(M, c): r = M for k in c: print 'int(r/k) = ', int(r/k), 'r =', r, 'k =', k, 'r/k =', r/k r = r - (k*int(r/k)) intT

Re: beta.python.org content

2006-01-26 Thread Michael Tobis
I like the design, though I'd prefer stronger colors. I think it would be a major improvement except for the logo. I agree with others that the logo is a serious disappointment. Although the symmetry has some initial appeal, I do not see or want to see a two-ness about Python, and I find it distur

Re: good library for pdf

2006-01-26 Thread David M. Cooke
"Murali" <[EMAIL PROTECTED]> writes: > Pulling out pages from existing PDF files can be done with Open Source > stuff. The simplest would be pdftk (PDF Toolkit). The most fancy will > be using latex and the pdfpages package together with pdflatex. > > - Murali There's also pyPDF, at http://pybrar

Re: Python String Substitution

2006-01-26 Thread John Bauman
"Murali" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In Python, dictionaries can have any hashable value as a string. In > particular I can say > > d = {} > d[(1,2)] = "Right" > d["(1,2)"] = "Wrong" > d["key"] = "test" > > In order to print "test" using % substitution I can say

Re: beta.python.org content

2006-01-26 Thread Michael Tobis
newer success stories please... mt -- http://mail.python.org/mailman/listinfo/python-list

Re: generating method names 'dynamically'

2006-01-26 Thread Daniel Nogradi
> Here you go: > > >>> database = { > ... "Alice": 24, > ... "Bob":25} > ... > >>> class Lookup(object): > ... def __catcher(self, name): > ... try: > ... print "Hello my name is %s and I'm %s" % (name, > database[name]) > ... except KeyErro

Re: generating method names 'dynamically'

2006-01-26 Thread Michael Spencer
Daniel Nogradi wrote: ... > - database content --- > > Alice 25 > Bob 24 > > - program1.py - > > class klass: ... > > inst = klass() > > - program2.py --- > > import program1 > > # The code in klass above should be such that the following

Re: ODBC

2006-01-26 Thread Roger Upole
>From the syntax, this appears to be the odbc module included with the Pywin32 package. http://sourceforge.net/projects/pywin32/ You probably have it installed with the 2.1.1 version, but not 2.4. hth Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I would like to

Re: Python String Substitution

2006-01-26 Thread Steven D'Aprano
On Thu, 26 Jan 2006 15:40:47 -0800, Murali wrote: > In Python, dictionaries can have any hashable value as a string. No. Dictionaries can have any hashable value as a KEY. They are not automatically converted to strings. > In particular I can say > > d = {} > d[(1,2)] = "Right" > d["(1,2)"] = "

Re: generating method names 'dynamically'

2006-01-26 Thread Daniel Nogradi
> > My database has 1 table with 2 fields, one called 'name' and the other > > one called 'age', let's suppose it has the following content, but this > > content keeps changing: > > > > Alice 25 > > Bob 24 > > > > --- program1.py > > > > class klass: > > > > # do the

Re: Changing numbers into characters using dictionaries

2006-01-26 Thread Colin Fox
On Thu, 26 Jan 2006 20:35:26 +, Danny wrote: > Hello again, > > I am now trying to make something to change some "encrypted" text into > some plain text, here is the code I have so far: > > text = '@[EMAIL PROTECTED]@[EMAIL PROTECTED]' // some text > num = '213654' // Number > s1 = '700' >

Re: Codec Search Function

2006-01-26 Thread James Stroud
Giovanni Bajo wrote: > James Stroud wrote: > > >>I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to >>find the codec for several encodings (hex, base64, etc.). I resorted >>to writing my own for hex, just to see if I could get my program >>deployed. But I think a more permanent s

Re: generating method names 'dynamically'

2006-01-26 Thread Peter Hansen
Daniel Nogradi wrote: > Thanks for all the replies, it became clear that I need to look into > getattr, __getattr__ and __call__. I'll do that, but since you asked, > here is the thing I would like to do in a little more detail: > > My database has 1 table with 2 fields, one called 'name' and the

Re: beta.python.org content

2006-01-26 Thread Carl Banks
Roel Schroeven wrote: > Steve Holden schreef: > > How does > > > > http://beta.python.org/about/beginners/ > > > > look? > > I think it's OK, apart from the fact that the font size of the text > overrides my browser's default. It looks and reads much better without > the font-size: 75%. I'll sec

Re: ImportError: No module name MySQLdb

2006-01-26 Thread Fred
Fixed... All I did was change #!/usr/bin/python to #!/usr/local/bin/python The page loaded right up it was loading Python ver 2.4.1 rather than 2.4.2 where the MySQL db module was installed... I knew it would be something easy... I learned something so it was worth it... -- http://mail.pyt

Re: good library for pdf

2006-01-26 Thread Murali
Pulling out pages from existing PDF files can be done with Open Source stuff. The simplest would be pdftk (PDF Toolkit). The most fancy will be using latex and the pdfpages package together with pdflatex. - Murali -- http://mail.python.org/mailman/listinfo/python-list

Re: generating method names 'dynamically'

2006-01-26 Thread Daniel Nogradi
> > Is it possible to have method names of a class generated somehow > dynamically? > > > > More precisely, at the time of writing a program that contains a class > > definition I don't know what the names of its callable methods should > > be. I have entries stored in a database that are changing

Re: generating method names 'dynamically'

2006-01-26 Thread Murali
x.__class__.__dict__[mname](x,*args,**kwargs) here x is an instance of a class FOO FOO has a method "bar" (if the value of mname is "bar") args is a tuple whose length is the number of positional arguments accepted by bar kwargs is a dictionary corresponding to the keyword arguments accepted by ba

Re: Problems with import of modules

2006-01-26 Thread Ilias Lazaridis
the sys.path.append has done the work. thanks. . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a Python collection from an text-file

2006-01-26 Thread Ilias Lazaridis
[EMAIL PROTECTED] wrote: > another approach (probably frowned upon, but it has worked for me) is > to use python syntax (a dictionary, say, or a list) and just import (or > reload) the file > this sounds good. can I import a whole collection of instances this way? - (thanks for all the other a

Re: generating method names 'dynamically'

2006-01-26 Thread Peter Hansen
Daniel Nogradi wrote: > Is it possible to have method names of a class generated somehow dynamically? > > More precisely, at the time of writing a program that contains a class > definition I don't know what the names of its callable methods should > be. I have entries stored in a database that ar

Re: generating method names 'dynamically'

2006-01-26 Thread Murali
import inspect x = ABC() # create an instance of class ABC print inspect.getmembers(x,inspect.ismethod) Most of any introspection stuff can be done using the module "inspect". -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic Logging

2006-01-26 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Sorry if this is a FAQ but Google returns a *lot* of results for Python > Logging :-) > > I am looking for a tool that will automatically add logging to existing > code e.g. Function Entries and Exits, Return values etc. Perhaps you are looking for nothing more than thi

Re: generating method names 'dynamically'

2006-01-26 Thread Farshid Lashkari
> Is it possible to have method names of a class generated somehow dynamically? If you don't know the name of the method ahead of time, how do you write the code for it? Do you use some dummy name? If so, once you have the name determined then you could use setattr to set the method name. Here'

Python String Substitution

2006-01-26 Thread Murali
In Python, dictionaries can have any hashable value as a string. In particular I can say d = {} d[(1,2)] = "Right" d["(1,2)"] = "Wrong" d["key"] = "test" In order to print "test" using % substitution I can say print "%(key)s" % d Is there a way to print "Right" using % substitution? print "%((

[IDE] - The Dynamic Opportunity - ActiveState Komodo IDE / Open Source

2006-01-26 Thread Ilias Lazaridis
followup to comp.lang.perl.misc [I will read the other groups, too] - The following suggestions result out of an one-day website review of Active State [1]. - http://lazaridis.com/samples/com/ActiveState/ *Suggestions:* Near Future: *Open* Source the Komodo IDE. Immediately: *Free* th

generating method names 'dynamically'

2006-01-26 Thread Daniel Nogradi
Is it possible to have method names of a class generated somehow dynamically? More precisely, at the time of writing a program that contains a class definition I don't know what the names of its callable methods should be. I have entries stored in a database that are changing from time to time and

Re: beta.python.org content

2006-01-26 Thread James Stroud
Claudio Grondi wrote: > It looks very > commercial and has not the _fun_ and _ease_ in it I get used to face > when dealing with Python related icons. > The whole site is just as any other more or less commercial site and > even if it is sure much better than the old one, I will probably miss >

Re: Using non-ascii symbols

2006-01-26 Thread Christoph Zwerschke
Claudio Grondi wrote: > Speaking maybe only for myself: > I don't like implicit rules, so I don't like also any precedence > hierarchy being in action, so for safety reasons I always write even > 8+6*2 (==20) as 8+(6*2) to be sure all will go the way I expect it. But for people who often use ma

Re: beta.python.org content

2006-01-26 Thread James Stroud
Rocco Moretti wrote: > (Not that I like the logo, mind you...) Does anyone? There has to be a better logo! I thought the previous requirement as established by the BDFL was no snakes. These are snakes, and they have no personality to boot. -- http://mail.python.org/mailman/listinfo/python-list

Re: beta.python.org content

2006-01-26 Thread James Stroud
Paddy wrote: > I find it much better than the current site, thank you! > > Whilst reading, http://beta.python.org/about/ I had some slight > niggles. > What do you think about the following changes? > > About Python > > Python is an agile programming language often compared to Tcl, Perl, > Ruby,

Re: beta.python.org content

2006-01-26 Thread Claudio Grondi
Peter Maas wrote: > Tony Meyer schrieb: > >>> - The logo does indeed resemble a cross. How about rotating it at 45 deg >>>to make it look like an x? Or give it a circular shape? Please note >>>that there are no religious motives in this remark :) >> >> >> -1. Then what are the motives? >

Re: Question about isinstance()

2006-01-26 Thread Rocco Moretti
Mr.Rech wrote: > All in all it seems that the implementation that uses isinstance() is > better in this case... Well what's "better" depends on what you want to happen when you compare an unrelated class that also defines 'an_attribute'. Unlike in statically typed languages, certain things are m

Re: Are there memory limits for external C modules?

2006-01-26 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I've been working on an external C module for Python in order to use > > some of the functionality from Ethereal. Right now I'm getting > > segfaults originating from within the Ethereal source code, but the > > same code works fine when used no

Re: Question about isinstance()

2006-01-26 Thread Steven D'Aprano
On Thu, 26 Jan 2006 19:04:13 +0100, Rene Pijlman wrote: > Mr.Rech: >>Now, avoiding isinstace() I've written the following code: >> >>class foo(object): >> ... >> def __eq__(self, other): >> try: >> return self.an_attribute == other.an_attribute >> except AttributeError: >>

Re: Possible memory leak?

2006-01-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Tuvas wrote: > The modified version of my code is now as follows: (Note, a few small > changes have been made to simplify things, however, these things don't > apply to a full-scale picture, so the shouldn't slow anything down in > the slightest.) > > def load_pic_data(wid

Re: Running a DOS exe file from python

2006-01-26 Thread lblr33
I posted this earlier on yahoo groups and then realized that the most recent post was 2003. What I didn't realize is that it posted to this group so I posted it again. The other post is: http://groups.google.com/group/comp.lang.python/browse_thread/thread/6dc7c53dd00b99ed/da05733f4a83399f#da05733

ODBC

2006-01-26 Thread lblr33
I would like to connect to an Oracle database. In python version 2.1 I used the following code and it worked fine. When I run the code in version 2.4 it says that the odbc moduled does not exist. How do you connect to an Oracle database in v2.4? oradb=odbc.odbc('oracle/scott/tiger') stmt='selec

Running a DOS exe file from python

2006-01-26 Thread lblr33
I would like to execute a windows program from python and wait for it to finish before returning to the python script. The script I want to run has a set number of arguments. The following does work fine: os.system(r"c:\tmp\myprog.exe arg1 arg2 arg3") The problem I have is that the path to mypro

Automatic Logging

2006-01-26 Thread [EMAIL PROTECTED]
Sorry if this is a FAQ but Google returns a *lot* of results for Python Logging :-) I am looking for a tool that will automatically add logging to existing code e.g. Function Entries and Exits, Return values etc. Thanks, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good,

Re: 2-dimensional data structures

2006-01-26 Thread Claudio Grondi
anthonyberet wrote: > Hello again - rather a newbie here... > > I want to work on a sudoku brute-forcer, just for fun. > > I am considering different strategies, but first I need to decide on the > data-structure to use for the progress/solution grid. > > This being a square, I would have used

Re: beta.python.org content

2006-01-26 Thread Rocco Moretti
Peter Maas wrote: > - The logo does indeed resemble a cross. How about rotating it at 45 deg > to make it look like an x? Or give it a circular shape? Please note > that there are no religious motives in this remark :) It looks like a plus sign to me. Do you also advocate renaming "C++" to "

Re: www.mywebsite.py

2006-01-26 Thread Terry Reedy
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Simon Brunning wrote: >> On 1/24/06, Cyril Bazin <[EMAIL PROTECTED]> wrote: >> > Does someone ever tried (and succeed) to make an address like >> > "www.website.py". >> > I found that the .py extension is given to the para

Re: beta.python.org content

2006-01-26 Thread Peter Maas
Tony Meyer schrieb: >> - The logo does indeed resemble a cross. How about rotating it at 45 deg >>to make it look like an x? Or give it a circular shape? Please note >>that there are no religious motives in this remark :) > > -1. Then what are the motives? I don't like the shape. Snakes

Re: How to handle two-level option processing with optparse

2006-01-26 Thread Steven Bethard
R. Bernstein wrote: > Magnus Lycka informs: >> [in response to my comment]: >>> I see how I missed this. Neither disable_.. or enable_.. have document >>> strings. And neither seem to described in the optparser section (6.21) >>> of the Python Library (http://docs.python.org/lib/module-optparse.htm

Re: 2-dimensional data structures

2006-01-26 Thread Tim Chase
> I want to work on a sudoku brute-forcer, just for fun. Well, as everybody seems to be doing these (self included...), the sudoku solver may become the "hello world" of the new world :) > What is the equivalent way to store data in python? - It isn't obvious > to me how to do it with lists. S

Re: 2-dimensional data structures

2006-01-26 Thread Larry Bates
anthonyberet wrote: > Hello again - rather a newbie here... > > I want to work on a sudoku brute-forcer, just for fun. > > I am considering different strategies, but first I need to decide on the > data-structure to use for the progress/solution grid. > > This being a square, I would have used a

Re: 2-dimensional data structures

2006-01-26 Thread Carl Cerecke
anthonyberet wrote: > Hello again - rather a newbie here... > > I want to work on a sudoku brute-forcer, just for fun. I know what you mean. I wrote one just for fun too. > I am considering different strategies, but first I need to decide on the > data-structure to use for the progress/solution

Re: Changing numbers into characters using dictionaries

2006-01-26 Thread snoe
Ok there's a couple things going on here. > t = text.split('@') // splits the digits/blocks apart from each other this will give you a list: ['', '7706', '7002', '7075', '7704'] You may want to change the line to skip the first empty value: t = text.split('@')[1:] Next your loop. > something = 1

Re: 2-dimensional data structures

2006-01-26 Thread Carl J. Van Arsdall
anthonyberet wrote: > Hello again - rather a newbie here... > > I want to work on a sudoku brute-forcer, just for fun. > > I am considering different strategies, but first I need to decide on the > data-structure to use for the progress/solution grid. > > This being a square, I would have used a 9

Re: How to run a dos executable from python

2006-01-26 Thread Larry Bates
lblr33 wrote: > I have an executable (e.g. myprog.exe) which takes some set number of > arguments. > > This command works ok: > os.system(r"c:\tmp\myprog.exe arg1 arg2 arg3") > > The problem is that the path to the program and the arguments are > variable at runtime so I need to pass them as argu

2-dimensional data structures

2006-01-26 Thread anthonyberet
Hello again - rather a newbie here... I want to work on a sudoku brute-forcer, just for fun. I am considering different strategies, but first I need to decide on the data-structure to use for the progress/solution grid. This being a square, I would have used a 9x9 2-dimensional array in my tee

Re: Changing numbers into characters using dictionaries

2006-01-26 Thread Larry Bates
Danny wrote: > Hello again, > > I am now trying to make something to change some "encrypted" text into > some plain text, here is the code I have so far: > > text = '@[EMAIL PROTECTED]@[EMAIL PROTECTED]' // some text > num = '213654' // Number > s1 = '700' > s2 = '770' > s4 = '707' // it adds t

Re: How to run a dos executable from python

2006-01-26 Thread Fredrik Lundh
"lblr33" wrote: > I have an executable (e.g. myprog.exe) which takes some set number of > arguments. > > This command works ok: > os.system(r"c:\tmp\myprog.exe arg1 arg2 arg3") > > The problem is that the path to the program and the arguments are > variable at runtime so I need to pass them as arg

How to run a dos executable from python

2006-01-26 Thread lblr33
I have an executable (e.g. myprog.exe) which takes some set number of arguments. This command works ok: os.system(r"c:\tmp\myprog.exe arg1 arg2 arg3") The problem is that the path to the program and the arguments are variable at runtime so I need to pass them as arguments. Thanks -- http://

Changing numbers into characters using dictionaries

2006-01-26 Thread Danny
Hello again, I am now trying to make something to change some "encrypted" text into some plain text, here is the code I have so far: text = '@[EMAIL PROTECTED]@[EMAIL PROTECTED]' // some text num = '213654' // Number s1 = '700' s2 = '770' s4 = '707' // it adds these later on. t = text.split('@')

Re: Assigning to self.__class__

2006-01-26 Thread Terry Reedy
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have some places in pyparsing where I've found that the most > straightforward way to adjust an instance's behavior is to change its > class. > I do this by assigning to self.__class__, and things all work fine. > > (C

Re: beta.python.org content

2006-01-26 Thread Tony Meyer
> - The logo does indeed resemble a cross. How about rotating it at > 45 deg >to make it look like an x? Or give it a circular shape? Please note >that there are no religious motives in this remark :) -1. Then what are the motives? A rotated cross looks a lot less clean. Take a look

Re: Question about isinstance()

2006-01-26 Thread Mr.Rech
All in all it seems that the implementation that uses isinstance() is better in this case... Thanks for your comments, Andrea. -- http://mail.python.org/mailman/listinfo/python-list

Re: beta.python.org content

2006-01-26 Thread Paddy
I find it much better than the current site, thank you! Whilst reading, http://beta.python.org/about/ I had some slight niggles. What do you think about the following changes? About Python Python is an agile programming language often compared to Tcl, Perl, Ruby, Scheme or Java. While it has muc

Re: Question about isinstance()

2006-01-26 Thread Dave Benjamin
On Thu, 26 Jan 2006, Dave Benjamin wrote: > On Thu, 26 Jan 2006, Rocco Moretti wrote: > >>> You were better off with what you had before. Equality in this case is >>> left completely open-ended, and as a result, there is no way that you can >>> guarantee that "a == b" is the same as "b == a" if

Re: Question about isinstance()

2006-01-26 Thread Dave Benjamin
On Thu, 26 Jan 2006, Rocco Moretti wrote: >> You were better off with what you had before. Equality in this case is left >> completely open-ended, and as a result, there is no way that you can >> guarantee that "a == b" is the same as "b == a" if "a" is a "foo" and "b" >> is of unknown type. Th

Re: beta.python.org content

2006-01-26 Thread Roel Schroeven
Steve Holden schreef: > How does > > http://beta.python.org/about/beginners/ > > look? I think it's OK, apart from the fact that the font size of the text overrides my browser's default. It looks and reads much better without the font-size: 75%. -- If I have been able to see further, it wa

Re: beta.python.org content

2006-01-26 Thread Peter Maas
Steve Holden schrieb: > How does > > http://beta.python.org/about/beginners/ > > look? I like it :) Some minor points: - The logo does indeed resemble a cross. How about rotating it at 45 deg to make it look like an x? Or give it a circular shape? Please note that there are no religious

Re: List of files to be opened

2006-01-26 Thread Fredrik Lundh
Carl J. Van Arsdall wrote: > > os.walk is your friend. Its has wonderful functionality. > > Don't you mean os.path.walk ? os.walk is a generator-based version of os.path.walk. instead of putting the logic in a callback function, you put it in a for loop: for root, dirs, files in os.walk(top

Re: Tkinter listener thread?

2006-01-26 Thread gregarican
Steve Holden wrote: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965 Thanks. I tried a variation of this Queue posting/Flag checking method and it worked to a tee. The problem was that my UDP socket query was blocking things so that thread was hanging everything up. So I used a soc

Re: Possible memory leak?

2006-01-26 Thread Tuvas
I have made one confirmation. The only identifiable difference that I have seen is that one runs on python 2.4.2, and the other 2.4.1. Oddly enough, it's the first one that's the one that is having more problems than the second... Why that is, I don't know. It still could be something else, but...

Re: List of files to be opened

2006-01-26 Thread Carl J. Van Arsdall
Ken Starks wrote: > yawgmoth7 wrote: > > >> Hello, I am currently writing a script that requires a few different >> files to be opened, and examined. What I need to be able to do is use >> something like: >> >> filelist = os.system("ls") >> > >> I cannot think of a way to do this, I could p

Re: List of files to be opened

2006-01-26 Thread Ken Starks
yawgmoth7 wrote: > Hello, I am currently writing a script that requires a few different > files to be opened, and examined. What I need to be able to do is use > something like: > > filelist = os.system("ls") > > > > I cannot think of a way to do this, I could put them in a list of > something o

Re: Question about isinstance()

2006-01-26 Thread Rocco Moretti
Dave Benjamin wrote: > On Thu, 26 Jan 2006, Mr.Rech wrote: > >> Suppose I'm writing a base class with an __eq__ special methods, using >> isinstance() I would have wrote: >> >> class foo(object): >>... >>def __eq__(self, other): >> return isinstance(other, type(self)) and self.an_at

Re: Mining strings from a HTML document.

2006-01-26 Thread Runsun Pan
>def extract(text,s1,s2): >''' Extract strings wrapped between s1 and s2. > >>>> t="""this is a test for extract() >that does multiple extract """ >>>> extract(t,'','') >['test', 'extract()', 'does multiple extract'] > >''' >beg = [1,0

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Tim Chase
>> "xyz123aaabbaaabab" >> >> where you have "aaab" in there twice. > > Good suggestion. I assumed that this would be a valid case. If not, the expression would need tweaking. >> ^([^b]|((? > Looks good, although I've been unable to find a good > explanation of the "negative lookbehind" constr

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The below seems to pass all the tests you threw at it (taking the modified > 2nd test into consideration) > > One other test that occurs to me would be > > "xyz123aaabbaaabab" > > where you have "aaab" in there twice. Good

Re: exporting multiple modules from one dll?

2006-01-26 Thread Andras Balogh
This worked, thanks! Farshid Lashkari wrote: > I believe you can export different modules from one dll, but you *MUST* > at least export a module that has the same name as the dll. -- http://mail.python.org/mailman/listinfo/python-list

loading modules in debug

2006-01-26 Thread Andras Balogh
The project I'm working on is written mainly C/C++, spiced with some Python scripts. Now, I have several dlls, which work both as a Python extension modules, exporting functions to Python via "initmodule", and as normal dynamic libraries, to which I link dynamically from within my C program. T

Re: Start a python interactive shell from python.

2006-01-26 Thread Fernando Perez
Bo Peng wrote: > > I think I find what I need: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355319 That's a nice, lightweight one. Note that if you want to have all the bells and whistles of ipython (and you have ipython already), then a simple if __name__ == '__namin__': f

Re: Question about isinstance()

2006-01-26 Thread Dave Benjamin
On Thu, 26 Jan 2006, Mr.Rech wrote: > I've read some thread about isinstance(), why it is considered harmful > and how you can achieve the same results using a coding style that > doesn't break polymorphism etc... Since I'm trying to improve my Python > knowledge, and I'm going to design a class h

Re: Question about isinstance()

2006-01-26 Thread Mr.Rech
Mmm... I've not considered such an event... Would you say it is one of those rare case in which isinstance() "can be used"? Any other suggestion? Thanks, Andrea -- http://mail.python.org/mailman/listinfo/python-list

Re: beta.python.org content

2006-01-26 Thread Rinzwind
I am not a design professional but since you didn't ask for professionals but for beginners ;-) ... - At the left hand side you used abbreviations (like PSF). Using the full name says more about the option. - I don't like capitals alot either (as used in the menu). - The corporate look of the site

Re: exporting multiple modules from one dll?

2006-01-26 Thread Farshid Lashkari
> I have a dll that contains all kinds of services (input, audio, video, > etc..), and I would like to export these to Python as separate modules. > Now, if I call Py_InitModule with a name that's different than the dll > name, I get an error. So what can I do? I believe you can export differe

Re: Tkinter listener thread?

2006-01-26 Thread gregarican
Grant Edwards wrote: > Unless tk.createfilehandler isn't supported no Wni32 > platforms?? Unfortunately that's the case. As of Python 2.3.4 under Windows XP the createfilehandler method isn't available. It's only for UNIX as Mac platforms AFAIK. Shame, as it would be relatively easy to implement

jython how to use Fit and Fitnesse

2006-01-26 Thread Mark Fink
Hi there, I want to ask how to use Fit and Fitnesse together to use testcases programmed in Jython. Resently I discussed with John Roth how PyFit would have to be changed to work together with Jython. This seems to be a lot of work and comes maybee with version 0.9 in mid 2006 if at all. I think th

Re: Question about isinstance()

2006-01-26 Thread Rene Pijlman
Mr.Rech: >Now, avoiding isinstace() I've written the following code: > >class foo(object): > ... > def __eq__(self, other): > try: > return self.an_attribute == other.an_attribute > except AttributeError: > return False This may give unexpected results when you compar

Re: Are there memory limits for external C modules?

2006-01-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I've been working on an external C module for Python in order to use > some of the functionality from Ethereal. Right now I'm getting > segfaults originating from within the Ethereal source code, but the > same code works fine when used normally (i.e. through Ethereal or

  1   2   3   >