Re: Question about timeit

2011-07-22 Thread Frank Millman
On Jul 22, 8:37 am, Stefan Behnel wrote: > Frank Millman, 22.07.2011 08:06: > > > > > > > I mentioned in a recent post that I noticed an inconsistency in timeit, and > > then reported that I must have made a mistake. > > > I have now identified my problem, but I don't understand it. > > > C:\Pytho

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Corey Richardson
Excerpts from rantingrick's message of Fri Jul 22 02:40:51 -0400 2011: > On Jul 22, 12:45am, Terry Reedy wrote: > > On 7/22/2011 12:48 AM, rantingrick wrote: > > > On Jul 21, 11:13 pm, Corey Richardson wrote: > > > Hmm. Archives are more like directories than files. Windows, at least, > > seems t

Re: Can someone help please

2011-07-22 Thread Jonathan Hartley
Hey! Is Billy a responder, rather than the OP? Sorry then! My previous point is entirely nullified. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can someone help please

2011-07-22 Thread Jonathan Hartley
Hey Billy. That may not be the important part of the code, but the many people giving up their free time to read it and help you don't know that. It's probably most helpful to give them a working example so as not to waste their time. Just sayin for future, is all. :-) Best regards, Jonathan -

Re: Question about timeit

2011-07-22 Thread Thomas Rachel
Am 22.07.2011 08:59 schrieb Frank Millman: My guess is that it is something to do with the console, but I don't know what. If I get time over the weekend I will try to get to the bottom of it. I would guess that in the first case, python (resp. timeit.py) gets the intended code for execution:

Writing a MUD Console

2011-07-22 Thread Jonathan Gardner
I had this idea on an easy way to write a MUD console. Basically, you start a program written in Python. This will connect to the MUD of your choice, and otherwise behave like Telnet. In fact, it will just spawn telnet to do all the hard work for you. As you type commands, they are piped directly

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Thomas Rachel
Am 22.07.2011 00:45 schrieb Terry Reedy: Whether or not they are intended, the rationale is that lining up does not work with proportional fonts. Who on earth would use proportional fonts in programming?! -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about timeit

2011-07-22 Thread Stefan Behnel
Thomas Rachel, 22.07.2011 10:08: Am 22.07.2011 08:59 schrieb Frank Millman: My guess is that it is something to do with the console, but I don't know what. If I get time over the weekend I will try to get to the bottom of it. I would guess that in the first case, python (resp. timeit.py) gets

Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Lars Gustäbel
On Thu, Jul 21, 2011 at 08:46:05PM -0700, rantingrick wrote: > I may have found the mother of all inconsitency warts when comparing > the zipfile and tarfile modules. Not only are the API's different, but > the entry and exits are differnet AND zipfile/tarfile do not behave > like proper file objec

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Lars Gustäbel
On Thu, Jul 21, 2011 at 10:58:37PM -0700, rantingrick wrote: > My hat is off to you Mr. Richardson. I've even considered creating my > own clean versions of these two modules, because heck, it is not that > difficult to do! However we must stop fixing these warts on a local > level Corey. We MUST c

Re: Writing a MUD Console

2011-07-22 Thread Chris Angelico
On Fri, Jul 22, 2011 at 6:20 PM, Jonathan Gardner wrote: > I had this idea on an easy way to write a MUD console. > > Basically, you start a program written in Python. This will connect to > the MUD of your choice, and otherwise behave like Telnet. In fact, it > will just spawn telnet to do all th

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Thomas Jollans
On 22/07/11 10:11, Thomas Rachel wrote: > Am 22.07.2011 00:45 schrieb Terry Reedy: > >> Whether or not they are intended, the rationale is that lining up does >> not work with proportional fonts. > > Who on earth would use proportional fonts in programming?! Why not? I don't (it doesn't work wit

Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Thomas Jollans
On 22/07/11 05:46, rantingrick wrote: > PS: I will be posting more warts very soon. This stdlib is a gawd > awful mess! Please don't. Not here. There's a wonderful bug tracker at python.org. Use that. That's where this kind of thing belongs. And, please, be concise. What's the point of shouting

Re: I am fed up with Python GUI toolkits...

2011-07-22 Thread sturlamolden
On 22 Jul, 02:34, Gregory Ewing wrote: > I think that's a bit of an exaggeration -- there's only > one major dependency on each platform, and it's a very > widely used one (currently PyObjC/PyGTK/PyWin32). And > I'm thinking about ways to reduce the dependencies further, Pyrex or Cython? -- ht

Re: WindowsError: exception: access violation

2011-07-22 Thread Thomas Jollans
> On Fri, Jul 22, 2011 at 7:47 AM, Benjamin Kaplan wrote: > Are you using a Cygwin build of Python? Trying to mix Cygwin with > normal Windows programs doesn't usually work very well. On 22/07/11 06:41, Sathish S wrote: > Benjamin thanks for replying. i'm not using the python that comes wi

Re: I am fed up with Python GUI toolkits...

2011-07-22 Thread sturlamolden
On 21 Jul, 16:52, Kevin Walzer wrote: > I bet that other scripting languages would > piggyback on top of it (Lua or Ruby bindings for Python's GUI toolkit, > anyone?) because doing that is less work than writing your own toolkit > from scratch. No doubt about that. Lua has a nice GUI toolkit by

Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread caccolangrifata
I'm very very new with python, and I have some experience with java programming, so probably you guys will notice. Anyway this is my question: I'd like to use class scope vars in method parameter, something like that class foo(object): __init__(self, len = 9): self.__myvar

Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Tim Chase
On 07/22/2011 03:26 AM, Lars Gustäbel wrote: On Thu, Jul 21, 2011 at 08:46:05PM -0700, rantingrick wrote: Tarfile is missing the attribute "fp" and instead exposes a boolean "closed". This mismatching API is asinine! Both tarfile and zipfile should behave EXACTLY like file objects What do you

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Karim
I think you did a typo it is def foo2(self, len = self._myvar): while i< len: dosomething You forget '.' dot between self and _myvar By the way in the function header you have only one '_' and in the init you have 2 '_'. Be careful that's not the same variable and behavior in

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Thomas Jollans
On 22/07/11 13:12, caccolangrifata wrote: > I'm very very new with python, and I have some experience with java > programming, so probably you guys will notice. > Anyway this is my question: > I'd like to use class scope vars in method parameter, something like > that > > class foo(object): > >

Re: What Programing Language are the Largest Website Written In?

2011-07-22 Thread blubb
You're partially right. As far as I know, Facebook uses "HipHop" which translates PHP to C++. -- http://mail.python.org/mailman/listinfo/python-list

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread caccolangrifata
On Jul 22, 1:33 pm, Thomas Jollans wrote: > On 22/07/11 13:12, caccolangrifata wrote: > > > I'm very very new with python, and I have some experience with java > > programming, so probably you guys will notice. > > Anyway this is my question: > > I'd like to use class scope vars in method paramete

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Thomas Jollans
On 22/07/11 13:32, Karim wrote: > > I think you did a typo > > it is > > def foo2(self, len = self._myvar): >while i< len: > dosomething > That, of course, won't work: the default argument (in this case: "self._myvar") is looked up when the function is created, and stored with th

Re: Question about timeit

2011-07-22 Thread Frank Millman
On Jul 22, 10:34 am, Stefan Behnel wrote: > Thomas Rachel, 22.07.2011 10:08: > > > > > > > Am 22.07.2011 08:59 schrieb Frank Millman: > > >> My guess is that it is something to do with the console, but I don't > >> know what. If I get time over the weekend I will try to get to the > >> bottom of i

Re: Question about timeit

2011-07-22 Thread Thomas Jollans
On 22/07/11 14:30, Frank Millman wrote: > This is what I get after modifying timeit.py as follows - > > if args is None: > args = sys.argv[1:] > + print(args) > > C:\>python -m timeit int(float('165.0')) > ["int(float('165.0'))"] > 10 loops, best of 3: 3.43 usec per loop >

Re: Convert '165.0' to int

2011-07-22 Thread Hrvoje Niksic
Frank Millman writes: > int(float(x)) does the job, and I am happy with that. I was just > asking if there were any alternatives. int(float(s)) will corrupt integers larger than 2**53, should you ever need them. int(decimal.Decimal(s)) works with numbers of arbitrary size. -- http://mail.pytho

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Neil Cerutti
On 2011-07-22, Thomas Rachel wrote: > Am 22.07.2011 00:45 schrieb Terry Reedy: >> Whether or not they are intended, the rationale is that lining >> up does not work with proportional fonts. > > Who on earth would use proportional fonts in programming?! Under the assumption that leading white spac

compiling qt app extensions with distutils

2011-07-22 Thread strattonbrazil
I'd like to extend my C++ Qt applicaition using distutils. Looking over the tutorial docs (http://docs.python.org/extending/ building.html#building), it seems fairly intuitive for simple examples, but I'm already using a rather complex qmake/Makefile system to get all my cpp files and libraries in

Re: Convert '165.0' to int

2011-07-22 Thread Grant Edwards
On 2011-07-22, Billy Mays wrote: > On 7/21/2011 10:40 PM, Thomas 'PointedEars' Lahn wrote: >> Billy Mays wrote: >> >>> On 07/21/2011 08:46 AM, Web Dreamer wrote: If you do not want to use 'float()' try: int(x.split('.')[0]) >>> >>> This is right. >> >> Assuming that the value of `x'

Re: compiling qt app extensions with distutils

2011-07-22 Thread Thomas Jollans
On 22/07/11 15:43, strattonbrazil wrote: > I'd like to extend my C++ Qt applicaition using distutils. Looking > over the tutorial docs (http://docs.python.org/extending/ > building.html#building), it seems fairly intuitive for simple > examples, but I'm already using a rather complex qmake/Makefil

Re: Convert '165.0' to int

2011-07-22 Thread Billy Mays
On 07/22/2011 10:21 AM, Grant Edwards wrote: While that may be clear to you, that's because you've made some assumptions. "Convert a properly formatted string representation of a floating point number to an integer" is not a rigorous definition. What does "properly formatted" mean? Who says t

Re: Writing a MUD Console

2011-07-22 Thread Ian Kelly
On Fri, Jul 22, 2011 at 3:25 AM, Chris Angelico wrote: > In the early days of Android, my brother couldn't find a decent MUD > client, so I whipped one up for him in Python. The project never went > very far, but it's a start. It works on Linux, not Windows; but since > you're referring to /usr/bi

Re: Convert '165.0' to int

2011-07-22 Thread Grant Edwards
On 2011-07-22, Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote: > On 07/22/2011 10:21 AM, Grant Edwards wrote: >> While that may be clear to you, that's because you've made some >> assumptions. "Convert a properly formatted string representation of a >> floating po

Re: Convert '165.0' to int

2011-07-22 Thread Billy Mays
On 07/22/2011 10:58 AM, Grant Edwards wrote: On 2011-07-22, Billy Mays<81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote: Properly formatted means that Python would accept the string as an argument to float() without raising an exception. Then you can't assume that '.' is t

Re: Convert '165.0' to int

2011-07-22 Thread Grant Edwards
On 2011-07-22, Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote: > On 07/22/2011 10:58 AM, Grant Edwards wrote: >> On 2011-07-22, Billy >> Mays<81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote: >>> Properly formatted means that Python would accep

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread bruno.desthuilli...@gmail.com
On Jul 22, 1:12 pm, caccolangrifata wrote: Totally OT but others already answered the question... > class foo(object): class names should start with an uppercase letter: class Foo(object): > >         __init__(self, len = 9): 1/ you want to add a "def" statement before "__init__" 2/ the argu

Re: compiling qt app extensions with distutils

2011-07-22 Thread strattonbrazil
I have a simple Qt app that renders a scene in OpenGL does some very basic geometry routines. I originally was planning extending my app just by including Python.h and the corresponding lib possibly using pythonqt, but every time I brought it up on the python mailing list, many would say I should

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Karim
You're right. Sure the method header is evaluated first I usually not fall in this trap when default is a list but a singleton one with the same id. I answered too fast, I did not understand if he forget the dot or what. And the double '_' in init was strange because he uses only one '_' after.

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread caccolangrifata
On Jul 22, 5:43 pm, "bruno.desthuilli...@gmail.com" wrote: > On Jul 22, 1:12 pm, caccolangrifata wrote: > > Totally OT but others already answered the question... > > > class foo(object): > > class names should start with an uppercase letter: > > class Foo(object): > > > > >         __init__(self

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread caccolangrifata
On Jul 22, 6:54 pm, Karim wrote: > You're right. Sure the method header is evaluated first I usually not > fall in this trap when default is a list but a singleton one with the same > id. > I answered too fast, I did not understand if he forget the dot or what. > And the double '_' in init was str

Re: Writing a MUD Console

2011-07-22 Thread Jonathan Gardner
On Fri, Jul 22, 2011 at 2:25 AM, Chris Angelico wrote: > Rather than attach it to this post, I've tossed the script onto my > MUD's web site. (Yes, I run a MUD. Your subject line grabbed my > attention!) Grab it from http://minstrelhall.com/RosMudAndroid.py and > give it a whirl! > That code is s

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread rantingrick
On Jul 22, 3:26 am, Lars Gustäbel wrote: > There is a reason why these two APIs are different. When I wrote tarfile > zipfile had already been existing for maybe 8 years and I didn't like its > interface very much. So, I came up with a different one for tarfile that in my > opinion was more gener

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Michiel Overtoom
On Jul 22, 2011, at 12:23, Thomas Jollans wrote: > On 22/07/11 10:11, Thomas Rachel wrote: >> Am 22.07.2011 00:45 schrieb Terry Reedy: >> >>> Whether or not they are intended, the rationale is that lining up does >>> not work with proportional fonts. >> >> Who on earth would use proportional fo

Re: Writing a MUD Console

2011-07-22 Thread Chris Angelico
On Sat, Jul 23, 2011 at 3:12 AM, Jonathan Gardner wrote: > On Fri, Jul 22, 2011 at 2:25 AM, Chris Angelico wrote: >> Rather than attach it to this post, I've tossed the script onto my >> MUD's web site. (Yes, I run a MUD. Your subject line grabbed my >> attention!) Grab it from http://minstrelhal

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Chris Angelico
On Sat, Jul 23, 2011 at 3:11 AM, rantingrick wrote: > WWrong! It is more that just a MERE preference. Tarfile and zipfile > are BOTH archive modules and as such should present a consistent API. > I really don't care so much about the actual details AS LONG AS THE > APIs ARE CONSISTENT! Python and

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Chris Angelico
Oh, and: On Sat, Jul 23, 2011 at 3:11 AM, rantingrick wrote: > Will you be starting with the zipfile API migration? > Will you? Rick, quit ranting and start coding. If you want things to happen, the best way is to do them. If you make a post on the dev list WITH A PATCH, or submit your patch on

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Karim
Be careful when using double underscore prefix the variable is "said" to be private but in fact you can modify it. It is a convention to say don't change it. And to discourage to use it python change its name to '___myvar' appending the prefix '_' to it. See with your example: karim@Requiem

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Chris Angelico
On Sat, Jul 23, 2011 at 3:05 AM, Michiel Overtoom wrote: > Indeed. Since Windows95 I always use a proportional font for programming: > >  http://www.michielovertoom.com/incoming/comic-sans-python.jpg > > It's so elegant and gives aesthetic pleasure to look at. http://xkcd.com/590/ ChrisA -- htt

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread rantingrick
On Jul 22, 3:49 am, Lars Gustäbel wrote: > One could get the impression that you are leading a grass-roots movement > fighting a big faceless corporation. Instead, what you're dealing with is this > warm and friendly Python community you could as well be a part of if you are a > reasonable guy an

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread rusi
On Jul 22, 10:05 pm, Michiel Overtoom wrote: > On Jul 22, 2011, at 12:23, Thomas Jollans wrote: > > > On 22/07/11 10:11, Thomas Rachel wrote: > >> Am 22.07.2011 00:45 schrieb Terry Reedy: > > >>> Whether or not they are intended, the rationale is that lining up does > >>> not work with proportiona

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Ian Kelly
On Fri, Jul 22, 2011 at 6:59 AM, Neil Cerutti wrote: > Under the assumption that leading white space is important for > code formatting, but that all alignment after that is > unimportant. ...unless you're trying to adhere to a line length limit. "80 characters" is a lot easier to do in a fixed-

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Ian Kelly
On Fri, Jul 22, 2011 at 11:43 AM, rusi wrote: > Also it is more optimized. For the same size -- and therefore > readability -- a proportional font packs in more text. More text == less readability. This is one of the reasons I limit my line lengths. -- http://mail.python.org/mailman/listinfo/py

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread rantingrick
On Jul 22, 10:43 am, "bruno.desthuilli...@gmail.com" wrote: > > class names should start with an uppercase letter: WRONG! Class identifiers should use the capwords convention * class Foo * class FooBar * class FooBarBaz -- PEP8.Naming_Conventi

Re: compiling qt app extensions with distutils

2011-07-22 Thread Thomas Jollans
On 22/07/11 18:22, strattonbrazil wrote: > I have a simple Qt app that renders a scene in OpenGL does some very > basic geometry routines. I originally was planning extending my app > just by including Python.h and the corresponding lib possibly using > pythonqt, but every time I brought it up on

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Thomas Jollans
On 22/07/11 20:38, rantingrick wrote: > On Jul 22, 10:43 am, "bruno.desthuilli...@gmail.com" > wrote: >> >> class names should start with an uppercase letter: > > WRONG! Class identifiers should use the capwords convention > All CamelCase names start with an uppercase letter. You "WRONG!" is wr

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Thomas Jollans
>> 2/ the argument name ('len') will shadow the builtin 'len' function >> within this function's scope. >> >>> self.__myvar = len > > I have experience in java programming so using function calling > without () is foolish for me XD, but that a great suggestion No function is being

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread John Gordon
In <8b6e5067-8861-4ffe-9e3f-4b932c798...@gc8g2000vbb.googlegroups.com> rantingrick writes: > On Jul 22, 10:43=A0am, "bruno.desthuilli...@gmail.com" > wrote: > > > > class names should start with an uppercase letter: > WRONG! Class identifiers should use the capwords convention > * class Foo

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Neil Cerutti
On 2011-07-22, Ian Kelly wrote: > On Fri, Jul 22, 2011 at 6:59 AM, Neil Cerutti wrote: >> Under the assumption that leading white space is important for >> code formatting, but that all alignment after that is >> unimportant. > > ...unless you're trying to adhere to a line length limit. "80 > ch

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Chris Angelico
On Sat, Jul 23, 2011 at 5:00 AM, John Gordon wrote: > ... rantingrick writes ... > >> WRONG! > > Why did you say he was wrong? It's Ranting Rick. Why did you expect anything else? :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread John Gordon
In <98u00kfnf...@mid.individual.net> Neil Cerutti writes: > You can fit much more code per unit of horizontal space with a > proportionally spaced font. As a result, that issue, while valid, > is significantly reduced. Is it? I assume one major reason for the 80-character limit is to help the p

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Neil Cerutti
On 2011-07-22, John Gordon wrote: > In <98u00kfnf...@mid.individual.net> Neil Cerutti writes: >> You can fit much more code per unit of horizontal space with a >> proportionally spaced font. As a result, that issue, while >> valid, is significantly reduced. > > Is it? I assume one major reason f

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Terry Reedy
On 7/22/2011 2:40 AM, rantingrick wrote: On Jul 22, 12:45 am, Terry Reedy wrote: Let me give some overall comments rather than respond point by point. Python-dev is a volunteer *human* community, not a faceless corporation, with an ever-changing composition (a very mutable set;-). It is too

Re: Convert '165.0' to int

2011-07-22 Thread rantingrick
On Jul 22, 7:42 am, Hrvoje Niksic wrote: > Frank Millman writes: > > int(float(x)) does the job, and I am happy with that. I was just > > asking if there were any alternatives. > > int(float(s)) will corrupt integers larger than 2**53, should you ever > need them.  int(decimal.Decimal(s)) works w

Re: Convert '165.0' to int

2011-07-22 Thread rantingrick
On Jul 22, 2:32 pm, rantingrick wrote: > >>> '{0:,.0f}'.format(2**53) > '9,007,199,254,740,992' Would have been better to say >>> '{0:,}'.format(2**53) '9,007,199,254,740,992' -- http://mail.python.org/mailman/listinfo/python-list

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread caccolangrifata
Think that you can call you class as you want. If you use CamelCase notation than you are pro programmer? These are just conventions for better code reading and understanding, if I wanna call mYCLasS() python don't report an error, so I think it's useless discuss in that thread about that stuff.

Re: compiling qt app extensions with distutils

2011-07-22 Thread strattonbrazil
> > I have a simple Qt app that renders a scene in OpenGL does some very > > basic geometry routines.  I originally was planning extending my app > > just by including Python.h and the corresponding lib possibly using > > pythonqt, but every time I brought it up on the python mailing list, > > many

Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Terry Reedy
On 7/22/2011 4:26 AM, Lars Gustäbel wrote: On Thu, Jul 21, 2011 at 08:46:05PM -0700, rantingrick wrote: PS: I will be posting more warts very soon. This stdlib is a gawd awful mess! I do not agree. Although I come across one or two odd things myself from time to time, I think the stdlib as a

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Brandon Harris
Poor sod? Makes it sound bad when you say it like that. I am not forced to work at that fixed width, but when I work with code, I often have my vim session split vertically and it's super important to keep things at 80 character to quickly read/edit code. Brandon L. Harris On 07/22/2011 02:13

Re: Convert '165.0' to int

2011-07-22 Thread Terry Reedy
On 7/22/2011 1:55 AM, Frank Millman wrote: As the OP, I will clarify what *my* requirement is. This discussion has gone off at various tangents beyond what I was asking for. Typical. Don't worry about it ;-). As suggested above, I am only talking about a string containing int literals follow

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread rantingrick
On Jul 22, 2:00 pm, John Gordon wrote: > Why did you say he (Bruno) was wrong? I'll admit my yelling the word "WRONG" may have been interpreted as me suggesting that bruno was completely wrong. Bruno is correct about all class identifiers starting with a capital letter HOWEVER if he just stops

Re: Can someone help please

2011-07-22 Thread rantingrick
On Jul 21, 12:02 pm, Gary wrote: -- > total = ' ' > os.chdir('/home/woodygar/Desktop/Docs') > for i in os.listdir('.'): -- "i" was a bad local var choice here! i and x are typically reserved to represe

Re: Convert '165.0' to int

2011-07-22 Thread Chris Angelico
On Sat, Jul 23, 2011 at 5:32 AM, rantingrick wrote: > That's nine-quadrillion people! Only for galactic measurements or > microscopic reasons would you need such large numbers. > Never decide that "nobody would need numbers bigger than X". Someone will. One common thing to do with big numbers is

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Chris Angelico
On Sat, Jul 23, 2011 at 5:16 AM, rantingrick wrote: > My chastisement of Bruno was only on the grounds of him failing to > offer the required amount of information to a new python programmer. > We should ALWAYS remove any ambiguities from our statements to new > users AND we should always link to

Decorator behavior

2011-07-22 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I am just trying to wrap my head around decorators in Python, and I'm confused about some behavior I'm seeing. Run the code below (slightly adapted from a Bruce Eckel article), and I get the following output: inside myDecorator.__init__() inside aFunction() Finished decorating aFunction() inside

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Chris Rebert
On Fri, Jul 22, 2011 at 12:13 PM, John Gordon wrote: > In <98u00kfnf...@mid.individual.net> Neil Cerutti writes: > >> You can fit much more code per unit of horizontal space with a >> proportionally spaced font. As a result, that issue, while valid, >> is significantly reduced. > > Is it?  I assu

Re: Decorator behavior

2011-07-22 Thread Ian Kelly
On Fri, Jul 22, 2011 at 2:38 PM, mhearne808[insert-at-sign-here]gmail[insert-dot-here]com wrote: > I am just trying to wrap my head around decorators in Python, and I'm > confused about some behavior I'm seeing.  Run the code below (slightly > adapted from a Bruce Eckel article), and I get the fol

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Ned Deily
In article , Terry Reedy wrote: > This introduced the problem that upgrading to Python 3 is no longer a > single thing. We really need 2to3.1 (the current 2to3), 2to3.2, 2to3.3, > etc, but someone would have to make the new versions, but no one, > currently, has the energy and interest to do t

Re: PEP 8 and extraneous whitespace

2011-07-22 Thread Corey Richardson
Excerpts from Chris Rebert's message of Fri Jul 22 16:56:15 -0400 2011: > On Fri, Jul 22, 2011 at 12:13 PM, John Gordon wrote: > > In <98u00kfnf...@mid.individual.net> Neil Cerutti > > writes: > > > >> You can fit much more code per unit of horizontal space with a > >> proportionally spaced font

Re: Use self.vars in class.method(parameters, self.vars)

2011-07-22 Thread Chris Torek
In article <0ddc2626-7b99-46ee-9974-87439ae09...@e40g2000yqn.googlegroups.com> caccolangrifata wrote: >I'm very very new with python, and I have some experience with java >programming, so probably you guys will notice. >Anyway this is my question: >I'd like to use class scope vars in method param

run a script getting 4 arguments from another script

2011-07-22 Thread souleymane yo
my initial file name is SpO2Sweep.loops.py In the new file I write this code to run the first one. [code:] import SpO2Sweep.loops.py SpO2Sweep.loops.py.run("com1","0","30","0.0001") and It looks like the arguments are not passed to the first file. can someone help me? -- http://mail.python.org/

Re: Decorator behavior

2011-07-22 Thread Dave Angel
On 01/-10/-28163 02:59 PM, mhearne808[insert-at-sign-here]gmail[insert-dot-here]com wrote: I am just trying to wrap my head around decorators in Python, and I'm confused about some behavior I'm seeing. Run the code below (slightly adapted from a Bruce Eckel article), and I get the following outp

Re: run a script getting 4 arguments from another script

2011-07-22 Thread Thomas Jollans
On 23/07/11 00:46, souleymane yo wrote: > my initial file name is SpO2Sweep.loops.py > In the new file I write this code to run the first one. > > [code:] > import SpO2Sweep.loops.py > SpO2Sweep.loops.py.run("com1","0","30","0.0001") > > > and It looks like the arguments are not passed to the fi

Re: compiling qt app extensions with distutils

2011-07-22 Thread Thomas Jollans
On 22/07/11 21:37, strattonbrazil wrote: >> Okay, your terminology was confused: you want to extend Python, not your >> application. > > Sorry, after I sent that e-mail, I realized I had already mixed up the > terms, where I should have written "embedding". > >> First of all, you don't technicall

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-22 Thread Terry Reedy
On 7/22/2011 5:17 PM, Ned Deily wrote: In article, Terry Reedy wrote: This introduced the problem that upgrading to Python 3 is no longer a single thing. We really need 2to3.1 (the current 2to3), 2to3.2, 2to3.3, etc, but someone would have to make the new versions, but no one, currently, has

Re: Question about timeit

2011-07-22 Thread Frank Millman
On Jul 22, 2:43 pm, Thomas Jollans wrote: > On 22/07/11 14:30, Frank Millman wrote: > > > > > > > This is what I get after modifying timeit.py as follows - > > >     if args is None: > >         args = sys.argv[1:] > > +       print(args) > > > C:\>python -m timeit int(float('165.0')) > > ["int(fl

Re: What Programing Language are the Largest Website Written In?

2011-07-22 Thread John Nagle
On 7/12/2011 4:54 AM, Xah Lee wrote: > Then, this question piqued me, even i tried to not waste my time. But > it overpowered me before i resisted, becuase i quickly spend 15 min to > write this list (with help of Google): > > 1 Google ◇ Java > 2 Facebook ◇ PHP > 3 YouTube ◇ Python

Re: I am fed up with Python GUI toolkits...

2011-07-22 Thread Tim Roberts
Gregory Ewing wrote: >sturlamolden wrote: > >> Or should modern deskop apps be written with something completely >> different, such as HTML5? > >I hope not! HTML is great for web pages, but not >everything should be a web page. I don't think your glibness is justified. There is a legitimate app

Re: Convert '165.0' to int

2011-07-22 Thread Frank Millman
On Jul 22, 9:59 pm, Terry Reedy wrote: > On 7/22/2011 1:55 AM, Frank Millman wrote: > > > As the OP, I will clarify what *my* requirement is. This discussion > > has gone off at various tangents beyond what I was asking for. > > Typical. Don't worry about it ;-). > > > As suggested above, I am onl