Re: Newb question: underscore

2008-06-05 Thread cokofreedom
> > My question is: Why would anyone decide to obfuscate something as easy > > to read as Python??? > > They didn't decide to obfuscate; they decided to follow a > strongly-expected convention for the name of that function by existing > users of the 'gettext' functionality, in contexts that predate

Re: Do this as a list comprehension?

2008-06-05 Thread Terry Reedy
"Mensanator" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Jun 5, 10:42?pm, John Salerno <[EMAIL PROTECTED]> wrote: | > Is it possible to write a list comprehension for this so as to produce a | > list of two-item tuples? | > | > base_scores = range(8, 19) | > score_costs = [0

Re: readline() & seek() ???

2008-06-05 Thread Chris
On Jun 6, 5:13 am, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: > Tim Roberts wrote: > > DataSmash <[EMAIL PROTECTED]> wrote: > >> I have a text file that contains thousands of lines and each line is > >> 256 characters long. > > >> This is my task: > >> For each line in the file, move to the 25th chara

Re: Newb question: underscore

2008-06-05 Thread Ben Finney
bvdp <[EMAIL PROTECTED]> writes: > My question is: Why would anyone decide to obfuscate something as easy > to read as Python??? They didn't decide to obfuscate; they decided to follow a strongly-expected convention for the name of that function by existing users of the 'gettext' functionality, i

Re: Newb question: underscore

2008-06-05 Thread John Fabiani
Skye wrote: > What is this doing? > > print >> fd, _(__doc__) > > > I'm guessing line-splitting __doc__ into a list, but what's that > leading underscore do? > > Thanks! I think it is standard practice to use the underscore for unicode converts. -- http://mail.python.org/mailman/listinfo/p

Re: Do this as a list comprehension?

2008-06-05 Thread Mensanator
On Jun 5, 10:42�pm, John Salerno <[EMAIL PROTECTED]> wrote: > Is it possible to write a list comprehension for this so as to produce a > list of two-item tuples? > > base_scores = range(8, 19) > score_costs = [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3] > print zip(base_scores, score_costs) > > I can't think

Do this as a list comprehension?

2008-06-05 Thread John Salerno
Is it possible to write a list comprehension for this so as to produce a list of two-item tuples? base_scores = range(8, 19) score_costs = [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3] print zip(base_scores, score_costs) I can't think of how the structure of the list comprehension would work in this case,

Re: readline() & seek() ???

2008-06-05 Thread Kam-Hung Soh
Tim Roberts wrote: DataSmash <[EMAIL PROTECTED]> wrote: I have a text file that contains thousands of lines and each line is 256 characters long. This is my task: For each line in the file, move to the 25th character, if the character is a "T", move to the 35th character of the line and read 5

Re: Register codec dynamically without copying module to lib/python/encodings/

2008-06-05 Thread Benjamin
On Jun 5, 2:57 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: > HI! > > I have a simple codec module for T.61 which principally works. I'd like > to use this codec without having to copy the module to > lib/python/encodings/. Is that possible? Can I can extend the encodings > search path or registe

Re: Newb question: underscore

2008-06-05 Thread bvdp
My guess would be someone has used the common convention of naming the "get the corresponding localised version of this string from the application's gettext database" function as '_' for convenience. Funny that this comes up. I just noticed this in some code I was looking at the other day.

Re: Guide to organizing modules?

2008-06-05 Thread bukzor
On Jun 5, 5:58 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Jun 6, 10:32 am, bukzor <[EMAIL PROTECTED]> wrote: > > > In summary: are there any good (or official) guidelines for how to > > organize and separate python functions and classes into modules? > > Hey bukzor, > > Are you familiar with the co

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 2:57 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "Russ P." <[EMAIL PROTECTED]> writes: > > By the way, my recollection is that in C++ access defaults to private > > if nothing is declared explicity. So normally the "private" > > declaration is unnecessary. If it is left out, your littl

Re: Guide to organizing modules?

2008-06-05 Thread alex23
On Jun 6, 10:32 am, bukzor <[EMAIL PROTECTED]> wrote: > In summary: are there any good (or official) guidelines for how to > organize and separate python functions and classes into modules? Hey bukzor, Are you familiar with the concept of packages in Python? http://docs.python.org/tut/node8.html

Guide to organizing modules?

2008-06-05 Thread bukzor
I've been finding at work that I've written a set of functions several times, sometimes with more or less features or bugs, so I've decided to take my small, useful functions and put them in some common place. I've made a module for this, but it is quickly becoming a jumbled mess of unrelated funct

Re: Please unregister this mail-address out of mailing-list.

2008-06-05 Thread bukzor
On Jun 5, 11:37 am, [EMAIL PROTECTED] wrote: > > -Original Message- > > From: Hank @ITGroup > > I am writing this letter to unsubscribe this mail-address from python > > mail-list. > > -- > >http://mail.python.org/mailman/listinfo/python-list > > No problem, Hank. You will be officially of

Re: Newb question: underscore

2008-06-05 Thread Skye
Ohh, it's a function _() call. Now it makes sense. Of course Python would be consistent... I was expecting trickery! It's actually from the Mailman source, def _(s) is a string function for i18n Thanks, Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Newb question: underscore

2008-06-05 Thread Ben Finney
Skye <[EMAIL PROTECTED]> writes: > What is this doing? > > print >> fd, _(__doc__) Without any context, it's impossible to know. > I'm guessing line-splitting __doc__ into a list, but what's that > leading underscore do? Look at the rest of the module to see where that name comes from; per

Re: Newb question: underscore

2008-06-05 Thread Gary Herron
Skye wrote: What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? It's calling a function with a single argument, like sqrt(x), except the function is named _ and the argument is named __doc__. The unders

Pickling exception object works in 2.4 but not 2.5

2008-06-05 Thread Brett Elliott
In 2.5, this is what I get: Python 2.5.2 (r252:60911, May 7 2008, 15:19:09) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class Foo(Exception): ... member = None ... def __init__(self,member): ... self.member=membe

Re: Python and Flaming Thunder

2008-06-05 Thread Dave Parker
On Jun 5, 7:57 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: >... wait, x = 8 and x = 10! > But how can that be, Dave? You and your elementary kids just told me > I can't have two values for x... x = 8 OR x = 10. ;) By the way, realtime fullscreen 3D graphics are now up and running under Windows.

Newb question: underscore

2008-06-05 Thread Skye
What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: parser recommendation

2008-06-05 Thread Alan Isaac
One other possibility: SimpleParse (for speed). http://simpleparse.sourceforge.net/> It is very nice. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: How "solid" is PyPy?

2008-06-05 Thread Carl Friedrich Bolz
Hi, [EMAIL PROTECTED] wrote: > I've been looking at PyPy recently, and I see it's reached version 1.0 > (and supports language version 2.4). Given that, I was wondering what > level of backwards-compatibility one can expect from future versions, > i.e. if I run code on, say, a translated stackles

configure fails

2008-06-05 Thread Mathieu Prevot
Hi, I have the following error on a OSX.5 OS with CC=icc and using the python-svn files: checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) I would like to help so we can compile python with icc/OSX. Mathieu -- http://mail.python.org/mailman/listinfo/python-list

Re: gcc error in Mac OS X

2008-06-05 Thread Mathieu Prevot
2008/6/6 Mathieu Prevot <[EMAIL PROTECTED]>: > 2008/6/5 Zhaojie Boulder <[EMAIL PROTECTED]>: >> Hello, >> I am new to Mac and used python in linux before. What I am trying to do is >> to install "Ipython" and "PyCogent" in Mac OS X. >> For PyCogent, after entering the package path, I typed "python

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 2:27 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), "Russ P." > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > would need to use a "mangled" name to access private data or methods. > > But you will be using the name many

soaplib newbie question

2008-06-05 Thread Jon Hune
hi everyone, I'm totally new to SOAP. Can anyone help with this soap question. I'm trying to use soaplib. I can't find many examples on using soaplib and what I have below if the standard hello world example I find online. Say I want to call the zzz service at yyy. I know that the service inputs

Re: gcc error in Mac OS X

2008-06-05 Thread Mathieu Prevot
2008/6/5 Zhaojie Boulder <[EMAIL PROTECTED]>: > Hello, > I am new to Mac and used python in linux before. What I am trying to do is > to install "Ipython" and "PyCogent" in Mac OS X. > For PyCogent, after entering the package path, I typed "python setup.py > install". The results are as follows: >

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Ben Finney <[EMAIL PROTECTED]> wrote: > > > Then what you're really testing is the interactions of the "push > > the button" function with its external interface: you're asserting > > that the "push the red button" functio

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Hrvoje Niksic
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > On 5 juin, 17:40, Gabriel Rossetti <[EMAIL PROTECTED]> > wrote: >> Hello everyone, >> >> I had read somewhere that it is preferred to use >> self.__class__.attribute over ClassName.attribute to access class (aka >> static) attributes. > > It's even

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Hrvoje Niksic
"Russ P." <[EMAIL PROTECTED]> writes: > By the way, my recollection is that in C++ access defaults to private > if nothing is declared explicity. So normally the "private" > declaration is unnecessary. If it is left out, your little trick won't > work. How about #define class struct -- http://mai

Cannot use Winpdb (or PyDev) to trace embedded Python script in MSVC++ application - ImportError: No module named _socket

2008-06-05 Thread Chris8Boyd
I am embedding Python in a MSVC++ (2005) application. The application creates some environment and then launches a Python script that will call some functions exported from the MSVC++ application. I want to be able to debug the Python script by using a debug server, like Winpdb (winpdb.org). I us

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Terry Reedy
"Casey McGinty" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Thu, Jun 5, 2008 at 5:40 AM, Gabriel Rossetti < | [EMAIL PROTECTED]> wrote: | | > Hello everyone, | > | > I had read somewhere that it is preferred to use self.__class__.attribute | > over ClassName.attribute to acc

Re: How to make py2.5 distutil to use VC2005?

2008-06-05 Thread Matthieu Brucher
2008/6/4 甜瓜 <[EMAIL PROTECTED]>: > Howdy, >This problem have puzzled me for a long time. I usually use > python2.5 in Windows, while VC2005 is installed. > However python25.lib is compiled by VC2003. When I use disutil to > build some C extensions, it complaints that > there is no VC2003. >

Re: Token Error: EOF in multiline statement

2008-06-05 Thread Terry Reedy
"Matimus" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Jun 5, 12:58 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: | > I'm not sure what it means but it always highlights the last line with | > nothing on it. My program has 63 lines and it highlights the 64th | > line. This keeps p

Re: line continuation for lines ending in "and" or "or"

2008-06-05 Thread Paul Boddie
On 5 Jun, 22:40, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > A line ending in an operator is ambiguous in that it *could* indicate that > the programmer intends to continue on the next line while it also could > indicate that the programmer forgot to finish before hitting return, or > that somethi

Re: Creating A Tuple From A List, Adding To Tuple As You Do

2008-06-05 Thread Terry Reedy
"Karsten Heymann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi Jeff, | | Jeff Nyman <[EMAIL PROTECTED]> writes: | > I did try this: | > | > for count in range(0, len(DC_List)): | > DC_List.insert(count, '') | | On additional note: You can be quite sure you'll never have to

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Casey McGinty
On Thu, Jun 5, 2008 at 5:40 AM, Gabriel Rossetti < [EMAIL PROTECTED]> wrote: > Hello everyone, > > I had read somewhere that it is preferred to use self.__class__.attribute > over ClassName.attribute to access class (aka static) attributes. I had done > this and it seamed to work, until I subclass

Re: line continuation for lines ending in "and" or "or"

2008-06-05 Thread Terry Reedy
"Russ P." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |. Well, it wouldn't be a bad idea for Python to do | what I thought it did, *plus* what I said it ought to do. A line ending in an operator is ambiguous in that it *could* indicate that the programmer intends to continue on

Re: Token Error: EOF in multiline statement

2008-06-05 Thread Matimus
On Jun 5, 12:58 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: > I'm not sure what it means but it always highlights the last line with > nothing on it. My program has 63 lines and it highlights the 64th > line. This keeps popping up whenever I try to run my program. Can you > please help me fix this?

Re: How to make py2.5 distutil to use VC2005?

2008-06-05 Thread Martin v. Löwis
> I really really wonder how to *force* distutil to use my specified compile. > eg: (pseudo) You need to make sure that both MSSdk and DISTUTILS_USE_SDK are set, see http://docs.python.org/dist/module-distutils.msvccompiler.html Regards, Martin -- http://mail.python.org/mailman/listinfo/python-l

Re: Proof that \ is a better line joiner than parenthetical sets

2008-06-05 Thread John Salerno
"Joshua Kugler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > However, according to the Zen of Python, the line before > > "Explicit is better than implicit." > > says: > > "Beautiful is better than ugly." > > And I think putting parenthesis around a multi-line statement is much >

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread David
On Wed, Jun 4, 2008 at 2:54 PM, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Ben Finney <[EMAIL PROTECTED]> wrote: > >> By definition, "private" functions are not part of the publicly >> documented behaviour of the unit. Any behaviour exhibited by some >> private compon

Re: How to make py2.5 distutil to use VC2005?

2008-06-05 Thread Terry Reedy
"??" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | When you use distutil to trigger compilation, a special *python script* | will check whether the default compiler is VS2003. If there is no | VS2003, this script will pop-up the error for incompatible compilers. | I really really

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Matthieu Brucher
2008/6/5 Russ P. <[EMAIL PROTECTED]>: > On Jun 5, 12:20 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > > > All somebody has to do to get at the private data is: > > > > #define private public > > # include > > #undef private > > Well, that shows the weakness of the C/C++ header files. The "include" >

Token Error: EOF in multiline statement

2008-06-05 Thread maehhheeyy
I'm not sure what it means but it always highlights the last line with nothing on it. My program has 63 lines and it highlights the 64th line. This keeps popping up whenever I try to run my program. Can you please help me fix this? -- http://mail.python.org/mailman/listinfo/python-list

Register codec dynamically without copying module to lib/python/encodings/

2008-06-05 Thread Michael Ströder
HI! I have a simple codec module for T.61 which principally works. I'd like to use this codec without having to copy the module to lib/python/encodings/. Is that possible? Can I can extend the encodings search path or register the module by calling a function? Ciao, Michael. -- http://mail.p

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Larry Bates
Russ P. wrote: On Jun 2, 5:11 pm, Paul Rubin wrote: "Russ P." <[EMAIL PROTECTED]> writes: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared p

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread [EMAIL PROTECTED]
On 5 juin, 17:40, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I had read somewhere that it is preferred to use > self.__class__.attribute over ClassName.attribute to access class (aka > static) attributes. It's even prefered to use self.attribute, unless you know you have bot

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 12:20 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > All somebody has to do to get at the private data is: > > #define private public > # include > #undef private Well, that shows the weakness of the C/C++ header files. The "include" directive merely does a simple text substitution, which

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Larry Bates
Gabriel Rossetti wrote: Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work, until I subclassed a class using this technique and from there on things s

Re: Question regarding re module

2008-06-05 Thread Tobiah
>> > It could be that the result overloads the __getattr__-method to delegate >> > calls to some object. Thus it's not part of the outer instance. >> > > Didn't I read that Py3 will support a __dir__ method so that classes > *could* report such pseudo-attributes in response to dir? > > -- Paul

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Russ P." <[EMAIL PROTECTED]> wrote: > In C++ (and > Java?), on the other hand, the "protected" keyword *really* prevents > the client from accessing the data or method, but it allows access to > derived classes. The "private" keyword goes further and prevents >

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread [EMAIL PROTECTED]
On 5 juin, 20:07, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 5, 4:47 am, Bruno Desthuilliers > > > [EMAIL PROTECTED]> wrote: > > Antoon Pardon a écrit : > > > > On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: > > >> On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > >>> What is it abou

Re: Proof that \ is a better line joiner than parenthetical sets

2008-06-05 Thread Chris Ortner
One or more spaces behind a \ used for joining a multi-line statement can already generate a SyntaxError exception. 2:1 for paranthesis -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting Math Problem

2008-06-05 Thread R�diger Werner
"BEES INC" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] ... Problem: Star Ratings People can rate cheeseburgers on my website with a star rating of 0-5 stars (whole stars only), 5 being mighty tasty and 0 being disgusting. I would like to show the average of everyone's rati

select.poll in MacOS Leopard?

2008-06-05 Thread Samuel Bayer
All - The Python that comes with MacOS 10.5 doesn't have select.poll. The MacOS X build from python.org does, and works fine in 10.5. Any idea why the Apple build is broken? Anybody come across this before? Thanks in advance - Sam Bayer The MITRE Corporation [EMAIL PROTECTED] -- http://mail.p

Re: Question regarding re module

2008-06-05 Thread Tim Golden
Paul McGuire wrote: On Jun 5, 7:11 am, Tomohiro Kusumi <[EMAIL PROTECTED]> wrote: It could be that the result overloads the __getattr__-method to delegate calls to some object. Thus it's not part of the outer instance. Didn't I read that Py3 will support a __dir__ method so that classes *could

RE: Please unregister this mail-address out of mailing-list.

2008-06-05 Thread Michael . Coll-Barth
> -Original Message- > From: Hank @ITGroup > I am writing this letter to unsubscribe this mail-address from python > mail-list. > -- > http://mail.python.org/mailman/listinfo/python-list > No problem, Hank. You will be officially off of this 'mail-list' after a visit to this site;

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
> For the record, I have made it abundantly clear that I don't think > Python should not have as rigorous an encapsulation regime as C++ or > Java. The worst that could happen with my proposition is that you > would need to use a "mangled" name to access private data or methods. > But you will be

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 11:25 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 5, 2:07 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > The "private" keyword goes further and prevents > > access even by derived classes. The double leading underscore in > > Python does no such thing. > > Who develops these der

Re: Tuples part 2

2008-06-05 Thread Ivan Illarionov
On 5 июн, 21:22, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 5, 11:48 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 июн, 19:38, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > On Jun 5, 11:21 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 июн, 18:56, Ivan Illar

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 4:53 am, Bruno Desthuilliers wrote: > Russ P. a écrit : > Given your very recent discovery of what 'dynamic' *really* means in > Python (like, for exemple, dynamically adding / replacing attributes - > including methods - on a per-class or per-instance basis), possibly, yes. My "very r

Re: Please unregister this mail-address out of mailing-list.

2008-06-05 Thread Patrick Stinson
you can unsubscribe yourself at the list info page (the same page you subscribed from) On Thu, Jun 5, 2008 at 10:22 AM, Hank @ITGroup <[EMAIL PROTECTED]> wrote: > Dear Python Staff, > I am writing this letter to unsubscribe this mail-address from python > mail-list. One problem is that this python

Please unregister this mail-address out of mailing-list.

2008-06-05 Thread Hank @ITGroup
Dear Python Staff, I am writing this letter to unsubscribe this mail-address from python mail-list. One problem is that this python community is so active that I always lost myself to find my business emails. So, I want to quit this mail-address from you, and want to set up a specific mail-box

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread George Sakkis
On Jun 5, 2:07 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > The "private" keyword goes further and prevents > access even by derived classes. The double leading underscore in > Python does no such thing. Who develops these derived classes ? A competitor ? A malicious hacker ? A spammer ? Who are yo

Re: ANN: Resolver One 1.1 released

2008-06-05 Thread Laura Creighton
Hey, Congratulations! Laura Creighton -- http://mail.python.org/mailman/listinfo/python-list

Re: Help need with subprocess communicate

2008-06-05 Thread Daniel Klein
On Tue, 3 Jun 2008 23:48:38 -0700 (PDT), [EMAIL PROTECTED] wrote: >On Jun 3, 11:23 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Tue, 3 Jun 2008 18:04:40 -0700 (PDT), [EMAIL PROTECTED] declaimed the >> following in comp.lang.python: >> >> >> >> > Hi Daniel, >> > Thanks for your reply.. >>

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 4:47 am, Bruno Desthuilliers wrote: > Antoon Pardon a écrit : > > > On 2008-06-04, NickC <[EMAIL PROTECTED]> wrote: > >> On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > >>> What is it about leading underscores that bothers me? To me, they are > >>> like a small pebble in your s

Re: gcc error in Mac OS X

2008-06-05 Thread Zhaojie Boulder
Hi Tommy, When I typed which gcc,nothing happened,I checked the /usr/bin path myself and gcc was not there. In fact, the Xcode folder is at the same level with the usr folder. Is there a way you can install Xcode in the right place? I did not find such a option during the installation process of X

Re: Pylons and memory use?

2008-06-05 Thread Joshua Kugler
John Salerno wrote: > Hi everyone. I was thinking about signing up with a web host that > supports Pylons (among many other things) and one of the differences > between the various plans is application memory for long-running > processes. The plan I'd like to sign up for has 80MB. Does anyone know

Re: Tuples part 2

2008-06-05 Thread George Sakkis
On Jun 5, 11:48 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On 5 июн, 19:38, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Jun 5, 11:21 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > On 5 июн, 18:56, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 июн, 18:19, "[EMAIL

Re: Proof that \ is a better line joiner than parenthetical sets

2008-06-05 Thread Joshua Kugler
John Salerno wrote: > According to the Zen of Python, "explicit is better than implicit", and > the section in the Reference Manual describing the \ line joiner is called > "Explicit line joining" and the section describing parentheticals is > called "Implicit line joining." > > So there! ;) Howe

Re: Interesting Math Problem

2008-06-05 Thread MRAB
On Jun 4, 9:03 am, "BEES INC" <[EMAIL PROTECTED]> wrote: > I've been awfully busy programming lately. My Django-based side > project is coming along well and I hope to have it ready for use in a > few weeks. Please don't ask more about it, that's really all I can say > for now. Anyways, I came acro

Re: gcc error in Mac OS X

2008-06-05 Thread Zhaojie Boulder
Hi Tommy, When I typed which gcc,nothing happened,I checked the /usr/bin path myself and gcc was not there. In fact, the Xcode folder is at the same level with the usr folder. Is there a way you can install Xcode in the right place? I did not find such a option during the installation process of Xc

Re: Import text file

2008-06-05 Thread alex23
On Jun 6, 2:28 am, Franck Y <[EMAIL PROTECTED]> wrote: > I have a text file where there is > > xxx=value > yyy=value > zzz=value > etc... > > I would like use the from myfile import > > Since it has not the extension py how can i read it ? > I know the way to do it with the open file but i thi

Re: Import removing first module component

2008-06-05 Thread alex23
On Jun 6, 1:44 am, koblas <[EMAIL PROTECTED]> wrote: > Another person pointed out that I should check on the __init__.py and > make sure lmtp is defined in the __all__ block. I didn't have an > __init__.py at that level of the tree, which must have been causing > problems, but clearly I don't unde

Import text file

2008-06-05 Thread Franck Y
Hello, I have a text file where there is xxx=value yyy=value zzz=value etc... I would like use the from myfile import Since it has not the extension py how can i read it ? I know the way to do it with the open file but i think this one is easier... Thansk Franck -- http://mail.python.org/

Loading Python programs on the net.

2008-06-05 Thread Noorhan Abbas
Hello, I have developed a program in Python.  I need to put this program on the web. Could somebody advice me on the different tools that I can use to do this job. My python program basically displays a tree ctrl that allows users to choose from it and displays text as an output.  I need to deve

Nested dictionary displays?

2008-06-05 Thread Robert Dailey
Hi, I'm using Python 3.0 (the latest as of now) and I have a very large dictionary that I'm attempting to do some processing on. The dictionary basically has strings in it, as well as other dictionaries which themselves also have strings. Using a display, I'm trying to (with as little code possibl

Re: Tuples part 2

2008-06-05 Thread Ivan Illarionov
On 5 июн, 19:38, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 5, 11:21 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 июн, 18:56, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > wrote: > > > > > On Jun 5, 3:49 pm,

ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Gabriel Rossetti
Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work, until I subclassed a class using this technique and from there on things started screwing up. I fi

Re: Import removing first module component

2008-06-05 Thread koblas
On Jun 4, 2:48 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > >  koblas <[EMAIL PROTECTED]> wrote: > > Have the following line: > >         import notewave.runner.LMTP > > > Yeilding the following error: > >         ImportError: No module named runner.LMTP >

mod_python installer fails

2008-06-05 Thread RossGK
I've been running python 2.5 for a while on WinXP, working fine. I code and compile in PyDev/Eclipse. I wanted to start playing with Django, but when I go to install mod_python for Apache 2.2 I get the error: python version 2.5 required, which was not found in the registry from the installe

Re: Tuples part 2

2008-06-05 Thread George Sakkis
On Jun 5, 11:21 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On 5 июн, 18:56, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 ÉÀÎ, 01:57,

Re: Tuples part 2

2008-06-05 Thread Ivan Illarionov
On 5 июн, 18:56, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > > > On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > On 5 ÉÀÎ, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > wrote: > > > > > Hi Everyone

Re: Tuples part 2

2008-06-05 Thread Ivan Illarionov
On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 ÉÀÎ, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > Hi Everyone, > > > > i have another question. What if i wanted to make n tuples, each

Re: Tuples part 2

2008-06-05 Thread Ivan Illarionov
On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > > > > > On 5 ÉÀÎ, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > Hi Everyone, > > > > i have another question. What if i wanted to make n tuples, each

Re: Creating A Tuple From A List, Adding To Tuple As You Do

2008-06-05 Thread Iain King
On Jun 5, 1:41 pm, Jeff Nyman <[EMAIL PROTECTED]> wrote: > Greetings all. > > The subject line of this thread is probably one of the worst ever. I > was trying to encapsulate what I am doing. Based on my new-found > knowledge from another thread, I'm able to get a list of directories > and they com

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread sturlamolden
On Jun 5, 3:26 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > So, you are stating that no API programmer using Python *ever* has a > valid or genuine reason for wanting (even if he can't have it) genuine > 'hiding' of internal state or members from consumers of his (or > her...) API? > > Michael Foordh

Proof that \ is a better line joiner than parenthetical sets

2008-06-05 Thread John Salerno
Goofy post of the day... According to the Zen of Python, "explicit is better than implicit", and the section in the Reference Manual describing the \ line joiner is called "Explicit line joining" and the section describing parentheticals is called "Implicit line joining." So there! ;) -- ht

Re: Tuples part 2

2008-06-05 Thread [EMAIL PROTECTED]
On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On 5 ÉÀÎ, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > > > Hi Everyone, > > > i have another question. What if i wanted to make n tuples, each with > > a list of coordinates. For example : > > > coords = list() > > for

Re: Python and Harry Potter?

2008-06-05 Thread Eduardo O. Padoan
On Thu, Jun 5, 2008 at 10:29 AM, Hans Nowak <[EMAIL PROTECTED]> wrote: > Helmut Jarausch wrote: >> >> Hi, >> just to let you know ... >> >> Today I've got an email from Amazon recommending me >> Harry Potter and the Deathly Hallows >> >> and they told me why they recommended this book, >> because I

Re: Creating A Tuple From A List, Adding To Tuple As You Do

2008-06-05 Thread Karsten Heymann
Hi Jeff, Jeff Nyman <[EMAIL PROTECTED]> writes: > I did try this: > > for count in range(0, len(DC_List)): > DC_List.insert(count, '') On additional note: You can be quite sure you'll never have to iterate over the length of a list (or tuple) in python. Just iterate over the list itself: for

Re:

2008-06-05 Thread Quentin Gallet-Gilles
I don't want to spoil the fun, so I'll just say that "range" is the key here. Quentin On Thu, Jun 5, 2008 at 3:43 PM, garywood <[EMAIL PROTECTED]> wrote: > Hi there. So I have a challenge in the Python book I am using (python > programming for the absolute beginner) that tells me to improve an

Re: Interesting Math Problem

2008-06-05 Thread Chuckk Hubbard
On Wed, Jun 4, 2008 at 11:03 AM, BEES INC <[EMAIL PROTECTED]> wrote: > My Solution (in Python): > > # round to one decimal place and > # separate into whole and fractional parts > parts = str(round(star_sum/num_raters, 1)).split('.') > whole = int(parts[0]) > frac = int(parts[1]) > if frac < 3: >

Re: Interesting Math Problem

2008-06-05 Thread Gary Herron
BEES INC wrote: I've been awfully busy programming lately. My Django-based side project is coming along well and I hope to have it ready for use in a few weeks. Please don't ask more about it, that's really all I can say for now. Anyways, I came across an interesting little math problem today and

Re: Python and Flaming Thunder

2008-06-05 Thread Dan Upton
On Thu, Jun 5, 2008 at 9:43 AM, John Salerno <[EMAIL PROTECTED]> wrote: > "Dave Parker" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > On May 20, 7:05 pm, Collin <[EMAIL PROTECTED]> wrote: > > --- > For example, consider the two statements: > > x = 8 > x = 10 > > The reacti

Re: Creating A Tuple From A List, Adding To Tuple As You Do

2008-06-05 Thread John Salerno
"Jeff Nyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does anyone have an > idea of a good approach here? I think it's pretty cool that all three responses to your question suggested the exact same solution. But I guess that in itself is a feature of Python. :) -- http:

Re: Tuples part 2

2008-06-05 Thread Ivan Illarionov
On 5 июн, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > i have another question. What if i wanted to make n tuples, each with > a list of coordinates. For example : > > coords = list() > for h in xrange(1,11,1): >for i in xrange(1, 5, 1) : > for j in xrange(1, 5

  1   2   >