Zope 3.4.0 Released!

2009-01-31 Thread Stephan Richter
January 29, 2009 - The Zope 3 development team announces the Zope 3.4.0 release. After 2 years of development, the Zope Foundation and the larger Zope community is proud to announce the release of Zope 3.4.0. The focus of the Zope 3.4 development effort has been the conversion from a monolithic

Re: import reassignment different at module and function scope

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 05:31:47 -0200, Brendan Miller catph...@catphive.net escribió: If I: import sys sys = sys.version This executes find but: import sys def f(): sys = sys.version This gives an error indicating that the sys on the right hand side of = is undefined. What gives?

Re: is python Object oriented??

2009-01-31 Thread Laszlo Nagy
M Kumar wrote: Object oriented languages doesn't allow execution of the code without class objects, what is actually happening when we execute some piece of code, is it bound to any class? Those who have time and consideration can help me There are many kinds of definitions for object

HTTPSConnection: client certificate auth

2009-01-31 Thread Mailing List SVR
Hi all, I have a soap client using ZSI, the other end is oracle soa 10.1.3.1.0 all works fine since some months. The last week oracle soa was configured to accept client certificate authentication over https. If I try to use the standard python httplib.HTTPSConnection library it fails with the

Re: Want to write a script to do the batch conversion from domain name to IP.

2009-01-31 Thread Hongyi Zhao
On Sat, 31 Jan 2009 04:10:39 -0200, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Fri, 30 Jan 2009 12:53:33 -0200, Hongyi Zhao hongyi.z...@gmail.com escribi$)A(.: See the following errors I in my case: $ python 'import site' failed; use -v for traceback import socket Traceback

Re: search speed

2009-01-31 Thread anders
Tanks everyone that spent time helping my, the help was great. Best regards Anders -- http://mail.python.org/mailman/listinfo/python-list

How to manipulate a contents of file as record structures

2009-01-31 Thread CK Raju
I have a text file containing the following alphanumerals. aa2255 hh11dpdpdpdp22 kkk21lokolkolko33 . I need to read the contents as single line, one after the other and append the sum of digits at the end. aa225577 hh11dpdpdpdp2233 kkk21lokolkolko3354

Re: How to manipulate a contents of file as record structures

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 08:35:44 -0200, CK Raju ck.thris...@gmail.com escribió: I have a text file containing the following alphanumerals. aa2255 hh11dpdpdpdp22 kkk21lokolkolko33 . I need to read the contents as single line, one after the other and append the sum of

Re: How to manipulate a contents of file as record structures

2009-01-31 Thread CK Raju
On Sat, Jan 31, 2009 at 4:19 PM, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: for line in f: do_something_with(line) Thanks a lot. CK Raju -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-01-31 Thread MC
Re ‘builtin’ is not a class. I think object ; not only class And builtin is an object. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't eval of generator expression work with locals?

2009-01-31 Thread Aaron Brady
On Jan 31, 1:08 am, Hendrik van Rooyen m...@microcorp.co.za wrote: Gabriel Genellina ga.@yaz.oo.com.ar wrote: snip or even like this: def foo(L, M, A):   for x in L:     for y in M:       yield x+A g = foo(iter(L), iter(M), A) In particular, I like the 2nd (all late binding).

Re: SimpleXMLRPCServer question

2009-01-31 Thread andrew cooke
On Jan 30, 11:59 pm, flagg ianand0...@gmail.com wrote: I am working on a very basic xmlrpc server, which will expose certain functions for administering BIND zone files.  The big problem I am having is parsing the incoming xmlrpc request.  Basically part of the [...] at the risk of repeating

Re: verilog like class w/ bitslicing int/long classtype

2009-01-31 Thread Marc 'BlackJack' Rintsch
On Fri, 30 Jan 2009 21:59:34 +0100, Stef Mientki wrote: Marc 'BlackJack' Rintsch wrote: On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: try this: class MyRegClass ( int ) : def __init__ ( self, value ) : self.Value = value def __repr__ ( self ) : line = hex (

Where to host a (Python) project?

2009-01-31 Thread andrew cooke
Hi, I have a new project, that I just released in beta (http:// www.acooke.org/lepl - a recursive decent parser with full backtracking). At the moment I am using pypi and setuptools for distribution (it's a pure python package) and I am happy with hosting static web pages (the manual and api doc

Why do operators and methods of built-in types differ

2009-01-31 Thread Csaba Hoch
Hi, if I write the following: 1+1 2 it seems to be exactly equivalent to this: (1).__add__(1) 2 However, if I write invalid code and try to add a list to an int, the errors will be different: 1+[] Traceback (most recent call last): File stdin, line 1, in module

Empty string is False right?

2009-01-31 Thread AJ Ostergaard
Hello, First post so bear with me if I'm being a numpty ... Is it me or is there something slightly counter intuitive and thus not so pythonesque about this: s = '' if s: True ... else: False ... False s and eval(s) '' Regards, AJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Empty string is False right?

2009-01-31 Thread Ralf Schoenian
AJ Ostergaard wrote: Hello, First post so bear with me if I'm being a numpty ... Is it me or is there something slightly counter intuitive and thus not so pythonesque about this: s = '' if s: True else: False False s and eval(s) '' Regards, AJ Hi, yes, the following

Re: Empty string is False right?

2009-01-31 Thread AJ Ostergaard
Hi Ralf, Thanks for that but why: '' and True '' Surely that should be False?!? Regards, AJ On 31 Jan 2009, at 12:12, Ralf Schoenian wrote: AJ Ostergaard wrote: Hello, First post so bear with me if I'm being a numpty ... Is it me or is there something slightly counter intuitive and thus

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 5:43 am, Tim Roberts t.robe...@cqu.edu.au wrote: Dan, Thanks - you're probably right - just my intuition said to me that rather than calculating that the 13th root of 4021503534212915433093809093996098953996019232 is 3221.2904208350265 there must be a quicker way of finding

Re: Empty string is False right?

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 10:16:19 -0200, AJ Ostergaard a...@cubbyhole.net escribió: Hi Ralf, Thanks for that but why: '' and True '' Surely that should be False?!? Python does short-circuit evaluation [1] and and or return one of its operands as soon as the outcome is determined, not just

Re: Empty string is False right?

2009-01-31 Thread Vlastimil Brom
2009/1/31 AJ Ostergaard a...@cubbyhole.net: Hi Ralf, Thanks for that but why: '' and True '' Surely that should be False?!? Regards, AJ see the docs: http://docs.python.org/reference/expressions.html#boolean-operations The expression x and y first evaluates x; if x is false, its

Re: Empty string is False right?

2009-01-31 Thread Bernd Nawothnig
On 2009-01-31, AJ Ostergaard wrote: Thanks for that but why: '' and True '' Surely that should be False?!? It is: #v+ bool('' and True) False #v- Bernd -- No time toulouse -- http://mail.python.org/mailman/listinfo/python-list

Re: Empty string is False right?

2009-01-31 Thread John Machin
On Jan 31, 11:12 pm, Ralf Schoenian r...@schoenian-online.de wrote: yes, the following evaluates to False: A much better way of describing the effect would be to say that the following are treated as false (no capital letter!) in a conditional context. empty String: '' empty list: [] empty

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread andrew cooke
On Jan 31, 8:51 am, Csaba Hoch csaba.h...@gmail.com wrote: What is the reason behind this difference between the __add__ operator and int.__add__? this is quite common in python. the special methods like __add__ are used to implement some functionality (like '+' in this case), but they are not

Re: Empty string is False right?

2009-01-31 Thread AJ Ostergaard
I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the expression is and and therefore should always return a boolean? I'll

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 09:51:35 -0200, Csaba Hoch csaba.h...@gmail.com escribió: if I write the following: 1+1 2 it seems to be exactly equivalent to this: (1).__add__(1) 2 However, if I write invalid code and try to add a list to an int, the errors will be different:

Re: Empty string is False right?

2009-01-31 Thread John Machin
On Jan 31, 11:16 pm, AJ Ostergaard a...@cubbyhole.net wrote: Hi Ralf, Thanks for that but why:   '' and True '' Surely that should be False?!? No, deliberately not. Read this for Python 3.0 http://docs.python.org/3.0/reference/expressions.html#boolean-operations and/or this for Python 2.X

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Csaba Hoch
Gabriel Genellina wrote: The operator + does more than blindy calling left.__add__(right). In this case, as int + list returns NotImplemented, it reverses the operands and tries right.__radd__(left), and only then it gives up and raises TypeError. The actual rules are a bit more complex,

Re: Where to host a (Python) project?

2009-01-31 Thread Martin
Hi, 2009/1/31 andrew cooke and...@acooke.org: However, i am thinking I could really do with: - a mailing list - simple bug tracking - subversion and am wondering which is the best (free) provider for these (the code is LGPL open source). I'd prefer a mailing list to something like google

Re: Empty string is False right?

2009-01-31 Thread Ben Finney
Ralf Schoenian r...@schoenian-online.de writes: yes, the following evaluates to False: empty String: '' empty list: [] empty tuple: () empty dict: {} 0, None and False of course More precisely: All the above evaluate as Boolean false. But only one of them evaluates to False: the object

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread andrew cooke
Just a correction: according to the doc, NotImplemented is not an error, but a returned value. curious, so it is. i wonder why there is both a special return value (NotIMplemented) and a related exception (NotImplementedError). seems very odd to have a value... andrew --

Re: is python Object oriented??

2009-01-31 Thread Steve Holden
MC wrote: Re ‘builtin’ is not a class. I think object ; not only class And builtin is an object. You can think what you like, but there is a fundamental difference between methods of a class and functions of a module. Until you appreciate that you will likely make mistakes. Don't worry,

Re: Where to host a (Python) project?

2009-01-31 Thread andrew cooke
On Jan 31, 9:59 am, Martin mar...@marcher.name wrote: There's tigris.org, savannah (savannah.gnu.org, nongnu.org), launchpad. All of them are fine to some extent, you might want to read up on PyMotW about how Doug Hellmann decided where to host his stuff. all i can find is that he is writing

Re: nth root

2009-01-31 Thread Steve Holden
Mark Dickinson wrote: On Jan 31, 5:43 am, Tim Roberts t.robe...@cqu.edu.au wrote: Dan, Thanks - you're probably right - just my intuition said to me that rather than calculating that the 13th root of 4021503534212915433093809093996098953996019232 is 3221.2904208350265 there must be a

Re: Empty string is False right?

2009-01-31 Thread D'Arcy J.M. Cain
On Sat, 31 Jan 2009 12:16:19 + AJ Ostergaard a...@cubbyhole.net wrote: '' and True '' Surely that should be False?!? Why? The first value evaluates to False in a boolean context and thus is returned in the above statement due to short circuit evaluation but is not itself False. You

Re: Empty string is False right?

2009-01-31 Thread Steve Holden
AJ Ostergaard wrote: I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the expression is and and therefore should always return a

Re: glob.fnmatch (was search speed)

2009-01-31 Thread Tim Chase
rdmur...@bitdance.com wrote: Quoth Tim Chase t...@thechases.com: PS: as an aside, how do I import just the fnmatch function? I tried both of the following and neither worked: from glob.fnmatch import fnmatch from glob import fnmatch.fnmatch I finally resorted to the contortion coded

Re: Where to host a (Python) project?

2009-01-31 Thread Martin
2009/1/31 andrew cooke and...@acooke.org: On Jan 31, 9:59 am, Martin mar...@marcher.name wrote: There's tigris.org, savannah (savannah.gnu.org, nongnu.org), launchpad. All of them are fine to some extent, you might want to read up on PyMotW about how Doug Hellmann decided where to host his

Re: py2exe + SQLite problem

2009-01-31 Thread Armin
Gabriel Genellina wrote: En Fri, 30 Jan 2009 09:50:08 -0200, Armin a...@nospam.org escribió: Right at the end: To install data files directly in the target directory, an empty string should be given as the directory. setup(..., data_files=[ ('', ['list/of/file/names',

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 1:23 pm, Steve Holden st...@holdenweb.com wrote: [Mark] power operation.  The integer - float conversion is probably quite significant, timewise. I bow to your superior intuition! Here's another timing that shows the significance of the int - float conversion: (non-debug build

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 1:23 pm, Steve Holden st...@holdenweb.com wrote: Much more significant points, given the limited precision of the doubles Python will be using. Could gmpy do this better, I wonder? Almost certainly, if exact results are wanted! At least, GMP has an mpz_root function; I don't know

Re: Where to host a (Python) project?

2009-01-31 Thread Michele Simionato
On Jan 31, 12:46 pm, andrew cooke and...@acooke.org wrote: Any recommendations? Google Code seems fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Empty string is False right?

2009-01-31 Thread Grant Edwards
On 2009-01-31, Vlastimil Brom vlastimil.b...@gmail.com wrote: 2009/1/31 AJ Ostergaard a...@cubbyhole.net: Hi Ralf, Thanks for that but why: '' and True '' Surely that should be False?!? Regards, AJ see the docs: http://docs.python.org/reference/expressions.html#boolean-operations

Re: Where to host a (Python) project?

2009-01-31 Thread eliben
andrew cooke wrote: Hi, I have a new project, that I just released in beta (http:// www.acooke.org/lepl - a recursive decent parser with full backtracking). At the moment I am using pypi and setuptools for distribution (it's a pure python package) and I am happy with hosting static web

Re: Where to host a (Python) project?

2009-01-31 Thread andrew cooke
On Jan 31, 11:22 am, eliben eli...@gmail.com wrote: code.google.com provides all of these in a free and convenient manner. Recommended. unfortunately google don't seem that reliable ;o) (have you tried a google search today?) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Christian Heimes
andrew cooke schrieb: Just a correction: according to the doc, NotImplemented is not an error, but a returned value. curious, so it is. i wonder why there is both a special return value (NotIMplemented) and a related exception (NotImplementedError). seems very odd to have a value... They

Re: py2exe + SQLite problem

2009-01-31 Thread Thomas Heller
Armin schrieb: As posted before ... set's my script (python 2.3): from distutils.core import setup import py2exe setup(windows=['dpconf.py'], data_files=[ , [proj_db,gsd_db,dachs2.xbm]] ) When I create the distribution I got the following err msg: *** copy data files ***

Re: py2exe + SQLite problem

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 11:51:16 -0200, Armin a...@nospam.org escribió: Gabriel Genellina wrote: En Fri, 30 Jan 2009 09:50:08 -0200, Armin a...@nospam.org escribió: Right at the end: To install data files directly in the target directory, an empty string should be given as the directory.

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 11:03:13 -0200, andrew cooke and...@acooke.org escribió: Just a correction: according to the doc, NotImplemented is not an error, but a returned value. curious, so it is. i wonder why there is both a special return value (NotIMplemented) and a related exception

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-31 Thread Aahz
In article 7xr62ufv1c@ruckus.brouhaha.com, Paul Rubin http://phr...@nospam.invalid wrote: a...@pythoncraft.com (Aahz) writes: CPython's primitive storage management has a lot to do with the simplicity of interfacing CPython with external libraries. Any solution that proposes to get rid

Re: Tkinter w.pack()?

2009-01-31 Thread W. eWatson
Steve Holden wrote: W. eWatson wrote: r wrote: On Jan 28, 10:12 pm, W. eWatson notval...@sbcglobal.net wrote: Where in the world is a description of pack() for Tkinter widgets? Is it some sort of general method for all widgets? I'm looking in a few docs that use it without ever saying where

Re: Tkinter w.pack()?

2009-01-31 Thread W. eWatson
Gabriel Genellina wrote: En Thu, 29 Jan 2009 14:55:13 -0200, W. eWatson notval...@sbcglobal.net escribió: Gabriel Genellina wrote: En Thu, 29 Jan 2009 02:57:04 -0200, W. eWatson notval...@sbcglobal.net escribió: The word pack doesn't exist on the NMT pdf. Maybe there's a newer one? There

Re: glob.fnmatch (was search speed)

2009-01-31 Thread rdmurray
Quoth Tim Chase python.l...@tim.thechases.com: rdmur...@bitdance.com wrote: What you want is: from fnmatch import fnmatch Oh, that's head-smackingly obvious now...thanks! My thought process usually goes something like I want to do some file-name globbing there's a glob

Re: Empty string is False right?

2009-01-31 Thread Diez B. Roggisch
AJ Ostergaard schrieb: Hi Ralf, Thanks for that but why: '' and True '' Surely that should be False?!? No. Please read the section in the language reference about the and/or operators. and will return the first false value, or the right side. Thus '' and True - '' True and '' - ''

fastest way to detect a user type

2009-01-31 Thread Robin Becker
Whilst considering a port of old code to python 3 I see that in several places we are using type comparisons to control processing of user instances (as opposed to instances of built in types eg float, int, str) I find that the obvious alternatives are not as fast as the current code; func0

Re: nth root

2009-01-31 Thread Dan Goodman
Mark Dickinson wrote: I'd also be a bit worried about accuracy. Is it important to you that the integer part of the result is *exactly* right, or is it okay if (n**13)**(1./13) sometimes comes out as slightly less than n, or if (n**13-1)**(1./13) sometimes comes out as n? I don't think

Re: nth root

2009-01-31 Thread Mensanator
On Jan 31, 8:05 am, Mark Dickinson dicki...@gmail.com wrote: On Jan 31, 1:23 pm, Steve Holden st...@holdenweb.com wrote: Much more significant points, given the limited precision of the doubles Python will be using. Could gmpy do this better, I wonder? Almost certainly, if exact results

Re: Empty string is False right?

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 4:36 AM, AJ Ostergaard a...@cubbyhole.net wrote:I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the

Re: Where to host a (Python) project?

2009-01-31 Thread ajaksu
On Jan 31, 1:03 pm, andrew cooke and...@acooke.org wrote: On Jan 31, 11:22 am, eliben eli...@gmail.com wrote: code.google.com provides all of these in a free and convenient manner. Recommended. unfortunately google don't seem that reliable ;o)  (have you tried a google search today?) You

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 30, 12:15 am, Chris Rebert c...@rebertia.com wrote: - Python supports encapsulation. Prefixing an attribute/method with an underscore indicates that other programmers should treat it as 'private'. However, unlike BD languages, Python itself does nothing to enforce this privacy, leaving

Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread W. eWatson
I see http://www.python.org/doc/2.5/ for 2.5 and http://docs.python.org/ for 2.6. I'm guessing these two pages differ somewhat in formats simply because someone decided to do so, and not that I'm in the wrong place for each of the two versions, correct? For example, somewhere down in the 2.5, I

Re: nth root

2009-01-31 Thread Mensanator
On Jan 31, 10:53 am, Mensanator mensana...@aol.com wrote: On Jan 31, 8:05 am, Mark Dickinson dicki...@gmail.com wrote: On Jan 31, 1:23 pm, Steve Holden st...@holdenweb.com wrote: Much more significant points, given the limited precision of the doubles Python will be using. Could gmpy do

Re: is python Object oriented??

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 9:08 AM, thmpsn@gmail.com wrote:On Jan 30, 12:15am, Chris Rebert c...@rebertia.com wrote: - Python supports encapsulation. Prefixing an attribute/method with an underscore indicates that other programmers should treat it as 'private'. However, unlike BD

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 4:48 pm, Dan Goodman dg.gm...@thesamovar.net wrote: I don't think accuracy is too big a problem here actually (at least for 13th roots). I just tested it with several hundred thousand random 100 digit numbers and it never made a mistake. Well, random numbers is one thing. But how

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread markobrien85
On Jan 30, 5:54 am, Jean-Paul Calderone exar...@divmod.com wrote: On Thu, 29 Jan 2009 08:38:43 -0800 (PST), markobrie...@gmail.com wrote: G'day I'm currentlyusingsocketserverto build a simple XMLSocket (an XML based protocol used for communication between flash and the outside world) server.

Re: Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 9:14 AM, W. eWatson notval...@sbcglobal.net wrote:I see http://www.python.org/doc/2.5/ for 2.5 and http://docs.python.org/ for 2.6. I'm guessing these two pages differ somewhat in formats simply because someone decided to do so, and not that I'm in the wrong place for each

Re: nth root

2009-01-31 Thread Dan Goodman
Mark Dickinson wrote: Well, random numbers is one thing. But how about the following: n = 12345**13 n 154662214940914131102165197707101295849230845947265625L int(n ** (1./13)) # should be 12345; okay 12345 int((n-1) ** (1./13)) # should be 12344; oops! 12345 Good point! Oops indeed.

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 30, 2:32 pm, Michael Torrie torr...@gmail.com wrote: Veerendra Ganiger wrote: Python is not purely object oriented programming, because we can write functions without any class. You are right, predefined class attributes are available when we write or execute a piece of python code

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Scott David Daniels
Csaba Hoch wrote: if I write the following: 1+1 2 it seems to be exactly equivalent to this: (1).__add__(1) 2 However, if I write invalid code and try to add a list to an int, the errors will be different: As has been explained, binary operators are trickier than the above

Re: Empty string is False right?

2009-01-31 Thread Scott David Daniels
Steve Holden wrote: AJ Ostergaard wrote: I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the expression is and and therefore should

Re: Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread Martin v. Löwis
I see http://www.python.org/doc/2.5/ for 2.5 and http://docs.python.org/ for 2.6. I'm guessing these two pages differ somewhat in formats simply because someone decided to do so, and not that I'm in the wrong place for each of the two versions, correct? Correct. The documentation format has

Re: nth root

2009-01-31 Thread ajaksu
On Jan 31, 12:03 pm, Mark Dickinson dicki...@gmail.com wrote: [...] t1 = timeit.Timer(x = n**power, n = 4021503534212915433093809093996098953996019232; power = 1./13) t2 = timeit.Timer(x = n**power, n = 4021503534212915433093809093996098953996019232.; power = 1./13) And by using a float

Re: search speed

2009-01-31 Thread Tim Rowe
2009/1/30 Scott David Daniels scott.dani...@acm.org: Be careful with your assertion that a regex is faster, it is certainly not always true. I was careful *not* to assert that a regex would be faster, merely that it was *likely* to be in this case. -- Tim Rowe --

Re: Python-list Digest, Vol 64, Issue 697

2009-01-31 Thread AJ Ostergaard
AJ Ostergaard wrote: I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the expression is and and therefore should always return a

Searching a file for multiple strings

2009-01-31 Thread gotbyrd
Hello, I'm fairly new with python and am trying to build a fairly simple search script. Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords. I've already written a script that can search for a single string through multiple files, now I just need to adapt

Re: len()

2009-01-31 Thread Andreas Waldenburger
On Sat, 31 Jan 2009 13:27:02 -0500 Pat p...@junk.net wrote: Tobiah wrote: Just out of curiosity, why was len() made to be it's own function? I often find myself typing things like my_list.len before I catch myself. Thanks, Toby I'm surprised that no one responded to that

Import Replacement

2009-01-31 Thread James Pruitt
Imagine there are two files horse.py and buffalo.py. horse.py is imported by another file rider.py. Is it possible to make it so that under certain circumstances possibly based on an environment variable or something similar that when rider.py imports horse.py, it actually imports buffalo.py sort

Import Replacement

2009-01-31 Thread James Pruitt
Imagine there are two files horse.py and buffalo.py. horse.py is imported by another file rider.py. Is it possible to make it so that under certain circumstances possibly based on an environment variable or something similar that when rider.py imports horse.py, it actually imports buffalo.py sort

Re: is python Object oriented??

2009-01-31 Thread Andreas Waldenburger
On Sat, 31 Jan 2009 09:11:03 +0100 Laszlo Nagy gand...@shopzeus.com wrote: Python is not a pure object oriented language, because it has other programming tools, for example functions. I'm not sure about the first part of the sentence, but Python's functions are objects. Check it in the

Re: Searching a file for multiple strings

2009-01-31 Thread Tim Chase
I'm fairly new with python and am trying to build a fairly simple search script. Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords. I've already written a script that can search for a single string through multiple files, now I just need to adapt it to

Re: Where to host a (Python) project?

2009-01-31 Thread Giampaolo Rodola'
On 31 Gen, 12:46, andrew cooke and...@acooke.org wrote: Hi, I have a new project, that I just released in beta (http://www.acooke.org/lepl- a recursive decent parser with full backtracking).  At the moment I am using pypi and setuptools for distribution (it's a pure python package) and I am

Re: Searching a file for multiple strings (PS)

2009-01-31 Thread Tim Chase
I'm fairly new with python and am trying to build a fairly simple search script. Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords. I've already written a script that can search for a single string through multiple files, now I just need to adapt it to

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 7:04 pm, ajaksu aja...@gmail.com wrote: also a great way make some innocent bystander waste his eyesight trying to figure out the magic trick :D Oh, come on! At least I put the two lines next to each other! :-) Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer question

2009-01-31 Thread flagg
On Jan 30, 8:12 pm, rdmur...@bitdance.com wrote: Quoth flagg ianand0...@gmail.com: I am working on a very basic xmlrpc server, which will expose certain functions for administering BIND zone files.  The big problem I am having is parsing the incoming xmlrpc request.  Basically part of the

Re: Where to host a (Python) project?

2009-01-31 Thread Andrey Demidov
I use Google Code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Import Replacement

2009-01-31 Thread Gary Herron
James Pruitt wrote: Imagine there are two files horse.py and buffalo.py. horse.py is imported by another file rider.py. Is it possible to make it so that under certain circumstances possibly based on an environment variable or something similar that when rider.py imports horse.py, it actually

Re: is python Object oriented??

2009-01-31 Thread Christian Heimes
thmpsn@gmail.com schrieb: But it's only a faking, and things such as inheritance and polymorphism are implemented clumsily (actually I'm not even sure about polymorphism). And of course, there are still no private members. Do you honestly believe that C++'s private members are really

help me python

2009-01-31 Thread aolsuppo
C:\Python26vnc.py Traceback (most recent call last): File C:\Python26\vnc.py, line 4, in module import PyD3DES ImportError: DLL load failed: The specified module could not be found. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to host a (Python) project?

2009-01-31 Thread andrew cooke
On Jan 31, 4:50 pm, Giampaolo Rodola' gne...@gmail.com wrote: Google Code. --- Giampaolohttp://code.google.com/p/pyftpdlib thanks - that's a nice example. i'm a bit concerned about the whole google corporation thing, but reading through the ideological check- sheet at savannah convinced me i

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote This allows people to meddle with internals, at their own risk, if it ends up being absolutely necessary. If it ends up being necessary, the class's design is flawed. (Though in this case, the flaw is easily solved by simply providing a getter.) No the class

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote: To be clear, python does not force you to lay out your code according to some strict object-oriented paradigm. But Python itself is still purely object-oriented, as is your script when parsed. But it's only a faking, and things such as inheritance and

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
Steve Holden wrote: You can think what you like, but there is a fundamental difference between methods of a class and functions of a module. Until you appreciate that you will likely make mistakes. Don't worry, though, we all learn from our mistakes. And this fundamental difference is? From

Re: SimpleXMLRPCServer question

2009-01-31 Thread rdmurray
Quoth flagg ianand0...@gmail.com: Let me see if i can elaborate on the requirements. I have 20+ different zone files. I want the xmlrpc server to be able to determine what zone file to open by looking at the incoming xml request. For example one of the functions I have now is to show a DNS

Re: Tkinter w.pack()?

2009-01-31 Thread Steve Holden
W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: r wrote: On Jan 28, 10:12 pm, W. eWatson notval...@sbcglobal.net wrote: Where in the world is a description of pack() for Tkinter widgets? Is it some sort of general method for all widgets? I'm looking in a few docs that use it

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 31, 2:27 pm, Christian Heimes li...@cheimes.de wrote: thmpsn@gmail.com schrieb: But it's only a faking, and things such as inheritance and polymorphism are implemented clumsily (actually I'm not even sure about polymorphism). And of course, there are still no private members.

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread Stephen Hansen
Cheers mate I had a look into twisted but was put off by the FAQ stating 1.0+ modules may or may not be stable, and only the 'core' is. I don't wanna be messing around with a potentially buggy server, so im gonna roll my own using the sockets module. You didn't read that FAQ right: its

Re: nth root

2009-01-31 Thread Robert Kern
On 2009-01-30 22:00, Tim Roberts wrote: Unfortunately, unless I'm doing something wrong, this appears to take 20 times as long... :-) What on earth are numpy and psyco? Do I need to watch the Lord of the Rings? No, but Google would help. -- Robert Kern I have come to believe that the

Re: nth root

2009-01-31 Thread Tim Roberts
Tim Roberts t.robe...@cqu.edu.au wrote: Thanks - you're probably right - just my intuition said to me that rather than calculating that the 13th root of 4021503534212915433093809093996098953996019232 is 3221.2904208350265 there must be a quicker way of finding out its between 3221 and

Re: help me python

2009-01-31 Thread andrew cooke
On Jan 31, 5:36 pm, aolsu...@gmail.com wrote: C:\Python26vnc.py Traceback (most recent call last):   File C:\Python26\vnc.py, line 4, in module     import PyD3DES ImportError: DLL load failed: The specified module could not be found. i'm surprised no-one has replied here. what is happening

Newbie Question: Can't multiply sequence by non-int of type 'str'

2009-01-31 Thread Paulo Repreza
Hi, I'm just learning the very basics of python and I ran into this problem in version 3.0/3000: x = input(x: ) x: 36 y = input(y: ) y: 42 print (x*y) Traceback (most recent call last): File pyshell#3, line 1, in module print (x*y) TypeError: can't multiply sequence by non-int of type

  1   2   >