Re: Dumb Stupid Question About List and String

2010-09-01 Thread Xavier Ho
On 2 September 2010 02:49, Alban Nona wrote: > Well what Iam trying to generate is that kind of result: > > listn1=['ELM001_DIF', 'ELM001_SPC', 'ELM001_RFL', 'ELM001_SSS', > 'ELM001_REFR', 'ELM001_ALB', 'ELM001_AMB', 'ELM001_NRM', 'ELM001_MVE', > 'ELM001_DPF', 'ELM001_SDW', 'ELM001_MAT', 'ELM001_

Re: Dumb Stupid Question About List and String

2010-09-01 Thread Xavier Ho
2010/9/2 Alban Nona > Hello Xavier, working great ! thank you very much ! :p > Do you know by any chance if dictionnary can be sorted asthis: > Look at the sorted() global function in the Python API. ;] Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Xavier Ho
On 7 September 2010 10:37, ceycey wrote: > I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', > '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', > '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', > '9.0601']. > How can I convert the

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-07 Thread Xavier Ho
On 7 September 2010 10:56, MRAB wrote: > > > Incidentally, there's a builtin function called 'input' so using it as > a variable name is a discouraged! :-) Right-o! Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: mutate dictionary or list

2010-09-07 Thread Xavier Ho
On 7 September 2010 22:05, Baba wrote: > > It would be great if someone could give me a brief explanantion of the > mutation concept. > In this case, to mutate is to change. If you must not mutate the list, you must not change it. In another words, reading from the list is fine. Writing to it i

Re: Current install methodolgy eggs?

2010-09-12 Thread Xavier Ho
On 13 September 2010 08:40, Ben Finney > wrote: > Paul Watson writes: > > > What is the currently favored installation process for Python > > applications? > > ‘python ./setup.py install’, using the standard library's Distutils > library. > I thought it was python setup.py install or ./setup

Re: Very stupid question about a % symbol

2010-09-16 Thread Xavier Ho
On 17 September 2010 01:25, J wrote: > Is there a better way to print a '%' in the string when also using > formating? > I believe %% will escape the % and prints it straight out. Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: Very stupid question about a % symbol

2010-09-17 Thread Xavier Ho
On 17 September 2010 12:48, Terry Reedy wrote: > Doubling an escape char, whatever it is, is a common convention: > >>> print("Print a {{}} format string line this: {{{}}}".format(2)) > Print a {} format string line this: {2} > Wow. That's convoluted. Took me a minute to process. Cheers, Xav --

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Xavier Ho
On 20 September 2010 07:59, Ken Watford > wrote: > > Not that I disagree with you, but you might find this helpful: > http://tinyurl.com/preview.php > -- > http://mail.python.org/mailman/listinfo/python-list > I don't think the OP wants a preview feature. The fact that you still have to go throu

Re: programming

2010-09-19 Thread Xavier Ho
On 20 September 2010 15:46, Jordan Blanton wrote: > I am in a computer science class in which I am supposed to be creating a > program involving a sine wave and some other functions. I understand the > concept of the problem, but I don't understand any of the "lingo" being > used. The directions

Re: programming

2010-09-19 Thread Xavier Ho
On 20 September 2010 16:25, Jordan Blanton wrote: > its not specific terms that i dont understand. its general directions. but > when i dont understand one or two key points in a sentence, its hard to > understand what the directions are telling me to do. Is it possible for you to share the sen

Re: programming

2010-09-20 Thread Xavier Ho
On 20 September 2010 16:38, Jordan Blanton wrote: > Honestly, if I knew what was being said, then yes. I posted the directions > to the project and what I've done so far but I have no idea if what I'm > doing is right at all. > > Jordan, correct me if I'm mistaken, but you didn't post the directi

Re: programming

2010-09-20 Thread Xavier Ho
Thanks Jordan. My reply will be in Blue. I apologise if this ever gets hard to read, but it's beginning to. On 20 September 2010 16:51, Jordan Blanton wrote: > "And so he started on a module that estimated the length of a sine wave. > Here is what he wrote: " > ok. what is a module? A Python

Re: programming

2010-09-20 Thread Xavier Ho
Okay, it looks like you're doing well. I'm just going through your second email now, and it seems many of my comments in the first email is irrelavent to you anymore, because you already knew how to do it. =] Let's have a look. Again, my reply is in Blue. . *And what I've attempted to do so far.

Re: programming

2010-09-20 Thread Xavier Ho
On 20 September 2010 17:29, Xavier Ho wrote: > Secondly, that doesn't even compile. Nor does > > xDistance=eval(input("Distance to the stop sign (in feet): ")) > Just correcting myself here. It compiles, but generates an error when you give it a number, which still f

Re: How on Factorial

2010-10-28 Thread Xavier Ho
On 27 October 2010 18:27, Arnaud Delobelle wrote: > True. It's far too verbose. I'd go for something like: > >f=lambda n:n<=0 or n*f(~-n) > > I've saved a few precious keystrokes and used the very handy ~- idiom! > Huh, I've never seen that one before. Seems to work on both positive and ne

Re: 'NoneType' object has no attribute 'bind'

2010-10-28 Thread Xavier Ho
On 28 October 2010 20:24, Alex wrote: > hi there, I keep getting the message in the Topic field above. > > Here's my code: > > self.click2=Button(root,text="Click Me").grid(column=4,row=10) > self.click2.bind("",self.pop2pop) > what am I doing wrong? > Try self.click2=Button(root,text="Click Me

Re: How on Factorial

2010-10-28 Thread Xavier Ho
On 28 October 2010 23:52, Dave Angel wrote: > The ~- trick only works on two's complement numbers. I've worked on > machines in the past that used one's complement, and this wouldn't work > there. > > DaveA > I imagine this wouldn't work on floating point numbers either. Cheers, Xav -- http:/

Re: How on Factorial

2010-10-28 Thread Xavier Ho
On 29 October 2010 00:13, Dave Angel wrote: > From the help: > > "The unary ~ (invert) operator yields the bitwise inversion of its plain or > long integer argument. The bitwise inversion of x is defined as -(x+1). It > only applies to integral numbers" > > Inverting the bits of a floating point

Re: factorial of negative one (-1)

2010-10-28 Thread Xavier Ho
On 29 October 2010 14:41, Bj Raz wrote: > > Since Python can't call functions, I would like to know if there is a work > around. > Python can't call functions? I'm sorry, but I may have misunderstood what you are trying to say. I'm not familiar with the mathematical definition of factorial, but

Re: Pythonic way of saying 'at least one of a, b, or c is in some_list'

2010-10-28 Thread Xavier Ho
On 29 October 2010 15:50, Paul Rubin wrote: > John Nagle writes: > >d1 = set('monday','tuesday') > >days_off = set('saturday','sunday') > >if not d1.isdisjoint(days_off) :... > >This is cheaper than intersection, since it doesn't have to > > allocate and construct a set. It just

Re: Pythonic way of saying 'at least one of a, b, or c is in some_list'

2010-10-29 Thread Xavier Ho
Not sure why you use the for-else syntax without a break or continue. And I'm also not sure on the readability. -Xav on his Froyo On 29/10/2010 6:21 PM, "HEK" wrote: > On Oct 28, 6:16 pm, "cbr...@cbrownsystems.com" > wrote: >> It's clear but tedious to write: >> >> if 'monday" in days_off or "tu

Re: What people are using to access this mailing list

2010-11-03 Thread Xavier Ho
Gmail. -Xav On 3 November 2010 18:02, John Bond wrote: > Hope this isn't too O/T - I was just wondering how people read/send to this > mailing list, eg. normal email client, gmane, some other software or online > service? > > My normal inbox is getting unmanageable, and I think I need to find

C++ comment in Javadoc style -> reStructuredText compiler?

2010-11-04 Thread Xavier Ho
Hey all, Apologies if I am posting this in the wrong list. Does anyone know of a good compiler for javadoc comment style into reStructuredText, for Sphinx to chew? Cheers, Xavier -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3