Re: Unit test failing please help

2011-08-26 Thread John Gordon
In ccbce61b-77e3-44fc-bbb8-fbd700732...@w28g2000yqw.googlegroups.com lblake treleven.ll...@gmail.com writes: Hi I am new to python I am at bit lost as to why my unit test is failing below is the code and the unit test: class Centipede(object): legs, stomach You aren't assigning any

Re: Unit test failing please help

2011-08-26 Thread Tim Wintle
On Fri, 2011-08-26 at 08:35 -0700, lblake wrote: Hi I am new to python I am at bit lost as to why my unit test is failing below is the code and the unit test: class Centipede(object): legs, stomach This doesn't do what you think it does. legs, stomach is a statement and is not defining

Please Help with vertical histogram

2011-07-11 Thread Cathy James
Please kindly help- i have a project where I need to plot dict results as a histogram. I just can't get the y- axis to print right. May someone please help? I have pulled my hair for the past two weeks, I am a few steps ahead, but stuck for now. def histo(his_dict = {1:16, 2:267, 3:267, 4:169

Re: Please Help with vertical histogram

2011-07-11 Thread Dan Stromberg
to plot dict results as a histogram. I just can't get the y- axis to print right. May someone please help? I have pulled my hair for the past two weeks, I am a few steps ahead, but stuck for now. def histo(his_dict = {1:16, 2:267, 3:267, 4:169, 5:140, 6:112, 7:99, 8:68, 9:61, 10:56, 11:35

Re: Please Help with vertical histogram

2011-07-11 Thread Thorsten Kampe
* Cathy James (Mon, 11 Jul 2011 19:42:10 -0500) Please kindly help- i have a project where I need to plot dict results as a histogram. I just can't get the y- axis to print right. May someone please help? I have pulled my hair for the past two weeks, I am a few steps ahead, but stuck for now

Re: Easy function, please help.

2011-02-11 Thread Stephen Hansen
On 2/10/11 7:34 PM, alex23 wrote: rantingrick rantingr...@gmail.com wrote: 1. When has 2 bytecode instructions EVER out weighed a solid readability feature's incorporation into Python? The original point was whether or not the code is identical, which Terry showed it was not. Rick does not

Re: Easy function, please help.

2011-02-10 Thread Benjamin Kaplan
On Thu, Feb 10, 2011 at 12:03 AM, Jason Swails jason.swa...@gmail.com wrote: On Wed, Feb 9, 2011 at 5:34 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 09/02/2011 21:42, Jason Swails wrote: You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why

Re: Easy function, please help.

2011-02-10 Thread Jason Swails
On Thu, Feb 10, 2011 at 3:31 AM, Benjamin Kaplan benjamin.kap...@case.eduwrote: On Wed, Feb 9, 2011 at 5:34 PM, MRAB pyt...@mrabarnett.plus.com wrote: Or typecast to an int if you want to neglect decimals before converting to a string, etc. [snip] Python doesn't have typecasting.

Re: Easy function, please help.

2011-02-10 Thread Ethan Furman
Jason Swails wrote: On Wed, Feb 9, 2011 at 8:16 PM, Ethan Furman wrote: while n: is plenty readable. n is either something or nothing, and something evaluates to True, nothing to False. Sure it's readable. But then you have to make sure that the loop will eventually take n down to

Re: Easy function, please help.

2011-02-10 Thread Terry Reedy
On 2/10/2011 11:52 AM, Ethan Furman wrote: Jason Swails wrote: How is while n != 0: any worse? 1. It is redundant, just like 'if bool_value is not False:'. Python programmers should understand the null value idiom. 2. It does 2 comparisons, 1 unneeded, instead of 1. For CPython, it adds 2

Re: Easy function, please help.

2011-02-10 Thread rantingrick
On Feb 10, 11:01 am, Terry Reedy tjre...@udel.edu wrote: On 2/10/2011 11:52 AM, Ethan Furman wrote: Jason Swails wrote: How is while n != 0: any worse? 1. It is redundant, just like 'if bool_value is not False:'. Python programmers should understand the null value idiom. 2. It does 2

Re: Easy function, please help.

2011-02-10 Thread Jason Swails
On Thu, Feb 10, 2011 at 12:01 PM, Terry Reedy tjre...@udel.edu wrote: On 2/10/2011 11:52 AM, Ethan Furman wrote: Jason Swails wrote: How is while n != 0: any worse? 1. It is redundant, just like 'if bool_value is not False:'. Python programmers should understand the null value idiom.

Re: Easy function, please help.

2011-02-10 Thread Steven D'Aprano
On Thu, 10 Feb 2011 12:01:57 -0500, Terry Reedy wrote: On 2/10/2011 11:52 AM, Ethan Furman wrote: Jason Swails wrote: How is while n != 0: any worse? 1. It is redundant, just like 'if bool_value is not False:'. Python programmers should understand the null value idiom. I find that if

Re: Easy function, please help.

2011-02-10 Thread alex23
rantingrick rantingr...@gmail.com wrote: 1. When has 2 bytecode instructions EVER out weighed a solid readability feature's incorporation into Python? The original point was whether or not the code is identical, which Terry showed it was not. The load constant should only happen once. The

Re: Easy function, please help.

2011-02-10 Thread Westley Martínez
On Tue, 2011-02-08 at 21:52 -0800, Nanderson wrote: def num_digits(n): count = 0 while n: count = count + 1 n = n / 10 return count This is a function that basically says how many digits are in a number. For example, print num_digits(44) 2 print

Re: Easy function, please help.

2011-02-09 Thread RJB
On Feb 8, 11:08 pm, Paul Rudin paul.nos...@rudin.co.uk wrote: It works because 0 tests false and because integer division yields integers... eventually you'll get something like 1/10 giving 0. It's not necessarily a good thing to rely on. For example if you try it after from __future__

Re: Easy function, please help.

2011-02-09 Thread Nicholas Devenish
On 09/02/2011 14:27, RJB wrote: What operator should I use if I want integer division? Ada and Pascal used div if I recall rightly. The operator for integer division is // -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread Terry Reedy
On 2/9/2011 9:27 AM, RJB wrote: On Feb 8, 11:08 pm, Paul Rudinpaul.nos...@rudin.co.uk wrote: It works because 0 tests false and because integer division yields integers... eventually you'll get something like 1/10 giving 0. It's not necessarily a good thing to rely on. For example if you try

Re: Easy function, please help.

2011-02-09 Thread rantingrick
On Feb 9, 1:08 am, Paul Rudin paul.nos...@rudin.co.uk wrote: Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some reason it's confusing me as to how it is exiting the loop

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why the while loop exits. You've also gotten advice about how to make your method more robust (i.e. force integer division). However, as surprising as this may be I'm actually with RR on this one

Re: Easy function, please help.

2011-02-09 Thread MRAB
On 09/02/2011 21:42, Jason Swails wrote: You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why the while loop exits. You've also gotten advice about how to make your method more robust (i.e. force integer division). However, as surprising as this

Re: Easy function, please help.

2011-02-09 Thread Rikishi42
On 2011-02-09, Michael Hrivnak mhriv...@hrivnak.org wrote: Your function only works if n is an integer. Example: num_digits(234) 3 num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int. Using your example of n==44, 44/10 == 4 and 4/10

Re: Easy function, please help.

2011-02-09 Thread Rikishi42
On 2011-02-09, rantingrick rantingr...@gmail.com wrote: On Feb 9, 1:08�am, Paul Rudin paul.nos...@rudin.co.uk wrote: Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some

Re: Easy function, please help.

2011-02-09 Thread rantingrick
On Feb 9, 5:00 pm, Rikishi42 skunkwo...@rikishi42.net wrote: [...] Using 0 as false and any other value as true is hardly unique to python. Lots of languages have been doing this long before Python even existed. Well, the only way to reply is to paraphrase an anecdotes my mother would tell me

Re: Easy function, please help.

2011-02-09 Thread Steven D'Aprano
On Thu, 10 Feb 2011 00:00:48 +0100, Rikishi42 wrote: I would have defined the flaw to be use of '/' for the integer division. Well, it was a long time ago, when it seemed like a good idea. Now, Python has // for integer division. -- Steven --

Re: Easy function, please help.

2011-02-09 Thread Westley Martínez
On Wed, 2011-02-09 at 06:51 -0800, rantingrick wrote: On Feb 9, 1:08 am, Paul Rudin paul.nos...@rudin.co.uk wrote: Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some

Re: Easy function, please help.

2011-02-09 Thread Littlefield, Tyler
Uh oh, I think we found RR's evil twin: another python to the modern day visionary. Example 1 is not explicit enough. Too much guessing is required by the reader! if list is empty, bla. if not, bla. it's not all that hard, and there's no guessing that needs to take place, honest. --

Re: Easy function, please help.

2011-02-09 Thread alex23
rantingrick rantingr...@gmail.com wrote: Well, the only way to reply is to paraphrase an anecdotes my mother would tell me often as a young lad... Mother: Just because other language developers choose to jump off the cliffs of implicit-ey should we jump also? You think of yourself as a

Re: Easy function, please help.

2011-02-09 Thread Ethan Furman
Jason Swails wrote: However, as surprising as this may be I'm actually with RR on this one (for a little) -- for code readability's sake, you should make your conditional more readable (i.e. don't depend on the fact that the iterations will take your test value down to 0 which conveniently in

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
On Wed, Feb 9, 2011 at 5:34 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 09/02/2011 21:42, Jason Swails wrote: You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why the while loop exits. You've also gotten advice about how to make your method

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
On Wed, Feb 9, 2011 at 8:16 PM, Ethan Furman et...@stoneleaf.us wrote: Jason Swails wrote: However, as surprising as this may be I'm actually with RR on this one (for a little) -- for code readability's sake, you should make your conditional more readable (i.e. don't depend on the fact that

Re: Easy function, please help.

2011-02-09 Thread drygal
On 9 Lut, 06:29, Michael Hrivnak mhriv...@hrivnak.org wrote: Your function only works if n is an integer.  Example: num_digits(234) 3 num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int.  Using your example of n==44, 44/10 == 4 and

Re: Easy function, please help.

2011-02-09 Thread Steven D'Aprano
On Wed, 09 Feb 2011 22:53:27 -0800, drygal wrote: I guess it needs: def num_digits(n): return len(str(n)) -1 I don't think so. num_digits(9) 0 -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread Terry Reedy
On 2/9/2011 6:00 PM, Rikishi42 wrote: numeric types. I would have defined the flaw to be use of '/' for the integer division. Guido agreed, and hence changed it (after much contentious discussion!). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Easy function, please help.

2011-02-08 Thread Nanderson
def num_digits(n): count = 0 while n: count = count + 1 n = n / 10 return count This is a function that basically says how many digits are in a number. For example, print num_digits(44) 2 print num_digits(7654) 4 This function counts the number of decimal digits in a

Re: Easy function, please help.

2011-02-08 Thread Michael Hrivnak
Your function only works if n is an integer. Example: num_digits(234) 3 num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int. Using your example of n==44, 44/10 == 4 and 4/10 == 0 Before each iteration of the while loop, the given

Re: Easy function, please help.

2011-02-08 Thread Nanderson
On Feb 8, 10:29 pm, Michael Hrivnak mhriv...@hrivnak.org wrote: Your function only works if n is an integer.  Example: num_digits(234) 3 num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int.  Using your example of n==44, 44/10 == 4

Re: Easy function, please help.

2011-02-08 Thread Paul Rudin
Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some reason it's confusing me as to how it is exiting the loop after a certain number of times. Help is appreciated, thanks.

Functions Not Fun (yet)-please help!

2011-01-16 Thread Cathy James
Dear all, I can't thank you enough for taking time from your busy schedules to assist me (and others) in my baby steps with Python. Learning about functions now and wondering about some things commented in my code below. Maybe someone can break it down for me and show me why i cant print the

Re: Functions Not Fun (yet)-please help!

2011-01-16 Thread Emile van Sebille
On 1/16/2011 6:49 AM Cathy James said... Dear all, I can't thank you enough for taking time from your busy schedules to assist me (and others) in my baby steps with Python. Learning about functions now and wondering about some things commented in my code below. Maybe someone can break it down

RE: Functions Not Fun (yet)-please help!

2011-01-16 Thread Joe Goldthwaite
-list-bounces+joe=goldthwaites@python.org] On Behalf Of Cathy James Sent: Sunday, January 16, 2011 7:49 AM To: python-list@python.org Subject: Functions Not Fun (yet)-please help! Dear all, I can't thank you enough for taking time from your busy schedules to assist me (and others) in my

Re: import site fails - Please Help

2010-11-17 Thread swapnil
On Nov 15, 1:46 pm, Helmut Jarausch jarau...@igpm.rwth-aachen.de wrote: Hi, I'm completely puzzled and I hope someone can shed some light on it. After cloning a running system, booting the new machine from a rescue CD, chroot to the new root partition, I get the following strange error from

import site fails - Please Help

2010-11-15 Thread Helmut Jarausch
Hi, I'm completely puzzled and I hope someone can shed some light on it. After cloning a running system, booting the new machine from a rescue CD, chroot to the new root partition, I get the following strange error from python upon startup python -v import site failed st= os.stat(path)

please help explain this result

2010-10-17 Thread Yingjie Lan
Hi, I played with an example related to namespaces/scoping. The result is a little confusing: a=1 def f(): a = a + 1 return a f() I suppose I will get 2 ( 'a' is redefined as a local variable, whose value is obtained by the value of the global variable 'a' plus 1). But

Re: please help explain this result

2010-10-17 Thread Nobody
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote: I played with an example related to namespaces/scoping. The result is a little confusing: a=1 def f(): a = a + 1 return a f() UnboundLocalError: local variable 'a' referenced before assignment If you want to modify a

Re: please help explain this result

2010-10-17 Thread Steven D'Aprano
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote: Hi, I played with an example related to namespaces/scoping. The result is a little confusing: [snip example of UnboundLocalError] Python's scoping rules are such that if you assign to a variable inside a function, it is treated as a

Re: please help explain this result

2010-10-17 Thread Yingjie Lan
From: Nobody nob...@nowhere.com The determination of local or global is made when the def statement is executed, not when the function is called. Thanks a lot for your reply, which is of great help! So, I assume that when the 'def' is executed, any name occurred will be categorized as

Re: please help explain this result

2010-10-17 Thread Yingjie Lan
--- On Sun, 10/17/10, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: (1) If you assign to a variable *anywhere* in the function, it is a local *everywhere* in the function. There is no way to have a variable refer to a local in some places of a function and a global in

Re: please help explain this result

2010-10-17 Thread Paul Kölle
Am 17.10.2010 13:48, schrieb Steven D'Aprano: On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote: Hi, I played with an example related to namespaces/scoping. The result is a little confusing: [snip example of UnboundLocalError] Python's scoping rules are such that if you assign to a

Re: please help explain this result

2010-10-17 Thread TomF
On 2010-10-17 10:21:36 -0700, Paul Kölle said: Am 17.10.2010 13:48, schrieb Steven D'Aprano: On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote: Hi, I played with an example related to namespaces/scoping. The result is a little confusing: [snip example of UnboundLocalError] Python's

Re: please help explain this result

2010-10-17 Thread Paul Kölle
Am 17.10.2010 19:51, schrieb TomF: On 2010-10-17 10:21:36 -0700, Paul Kölle said: Am 17.10.2010 13:48, schrieb Steven D'Aprano: On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote: Hi, I played with an example related to namespaces/scoping. The result is a little confusing: [snip

Re: please help explain this result

2010-10-17 Thread Gregory Ewing
Yingjie Lan wrote: So, I assume that when the 'def' is executed, any name occurred will be categorized as either local or global (maybe nonlocal?). Actually it happens earlier than that -- the bytecode compiler does the categorization, and generates different bytecodes for accessing these

Re: Please help: pylint does not work with Emacs23 on Windows

2010-10-05 Thread Dsrt Egle
://stackoverflow.com/questions/3827076/please-help-pylint-does-not-work-with-emacs23 -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help: pylint does not work with Emacs23 on Windows

2010-10-04 Thread Alexandre Fayolle
Alexandre Fayolle wrote: Dsrt Egle wrote: Hi, I am trying to use Pylint with Emacs on Windows XP. My Emacs version is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install pylint, I added the code block below to Emacs init file, copied form Emacs Wiki. there are some

Re: Please help: pylint does not work with Emacs23 on Windows

2010-10-04 Thread Alexandre Fayolle
Dsrt Egle wrote: Hi, I am trying to use Pylint with Emacs on Windows XP. My Emacs version is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install pylint, I added the code block below to Emacs init file, copied form Emacs Wiki. there are some files provided by pylint for

Please help: pylint does not work with Emacs23 on Windows

2010-09-30 Thread Dsrt Egle
Hi, I am trying to use Pylint with Emacs on Windows XP. My Emacs version is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install pylint, I added the code block below to Emacs init file, copied form Emacs Wiki. (when (load flymake t) (defun flymake-pylint-init ()

Re: Please help: pylint does not work with Emacs23 on Windows

2010-09-30 Thread Dsrt Egle
On Sep 30, 9:38 am, Dsrt Egle dsrte...@gmail.com wrote: Hi, I am trying to use Pylint with Emacs on Windows XP. My Emacs version is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install pylint, I added the code block below to Emacs init file, copied form Emacs Wiki.     (when

Sum of product-please help

2010-09-02 Thread Nally Kaunda-Bukenya
Dear all, kindly help me with this code; This script  is supposed to calculate Rvi for each row by first summing the product of #fields (Ai*Rv) and dividing by another field (Tot) such that  Rvi=sum(Ai*Rv)/Tot. First it's acting like I need another parenthesis and it doesn't seem to work at

Re: Sum of product-please help

2010-09-02 Thread MRAB
On 02/09/2010 23:01, Nally Kaunda-Bukenya wrote: Dear all, kindly help me with this code; This script is supposed to calculate Rvi for each row by first summing the product of #fields (Ai*Rv) and dividing by another field (Tot) such that Rvi=sum(Ai*Rv)/Tot. First it's acting like I need another

Re: How to implement a pipeline...??? Please help

2010-08-30 Thread Ritchy lelis
On 26 Ago, 08:52, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Tue, 24 Aug 2010 22:21:34 -0700 (PDT), Ritchy lelis ritchy_g...@hotmail.com declaimed the following in gmane.comp.python.general: hi friend Dennis Lee Bieber I have watching your code sujestion and now i can understand

Re: How to implement a pipeline...??? Please help

2010-08-24 Thread Ritchy lelis
On 11 Ago, 01:01, Ritchy lelis ritchy_g...@hotmail.com wrote: On 7 Ago, 07:30, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 6 Aug 2010 16:47:58 -0700 (PDT), Ritchy lelis ritchy_g...@hotmail.com declaimed the following in gmane.comp.python.general: Guys i'm asking if it's

Re: How to implement a pipeline...??? Please help

2010-08-10 Thread Ritchy lelis
On 7 Ago, 07:30, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 6 Aug 2010 16:47:58 -0700 (PDT), Ritchy lelis ritchy_g...@hotmail.com declaimed the following in gmane.comp.python.general: Guys i'm asking if it's possible for a generic function for a pipeline, all the suggestions

How to implement a pipeline...??? Please help

2010-08-06 Thread Ritchy lelis
Hi guys In the development of my ADC project i have a new new challenge. First i need to implement a 10 Bit pipelineADC that will be the basis to later implement any kind of pipeline arquitecture (i mean, with 10 Bit, 16 Bit or any other configuration i want) i wish to... What's a 10 Bit

please, help with python 3.1

2010-08-03 Thread Alan
Hello List, Please, can someone at least try this code below in python 3 and report me back whether it works or not? Because for me this code works in python 2.6 but not with python 3.1. Thanks! from __future__ import print_function import os, subprocess, signal def signal_handler( signum,

Re: please, help with python 3.1

2010-08-03 Thread Chris Rebert
On Mon, Aug 2, 2010 at 11:35 PM, Alan alanwil...@gmail.com wrote: Hello List, Please, can someone at least try this code below in python 3 and report me back whether it works or not? Because for me this code works in python 2.6 but not with python 3.1. Thanks! Please specify *in exactly what

Re: please, help with python 3.1

2010-08-03 Thread rantingrick
On Aug 3, 2:11 am, Chris Rebert c...@rebertia.com wrote: On Mon, Aug 2, 2010 at 11:35 PM, Alan alanwil...@gmail.com wrote: Hello List, Please, can someone at least try this code below in python 3 and report me back whether it works or not? Because for me this code works in python 2.6 but

Re: please, help with python 3.1

2010-08-03 Thread Chris Rebert
-- Forwarded message -- From: Alan alanwil...@gmail.com Date: Tue, Aug 3, 2010 at 12:25 AM Subject: Re: please, help with python 3.1 To: Chris Rebert c...@rebertia.com Sorry, I will explain. I am using for a task 'find /' expecting this to last longer, usually much longer than 5

Re: please, help with python 3.1

2010-08-03 Thread rantingrick
On Aug 3, 2:28 am, Chris Rebert c...@rebertia.com wrote: -- Forwarded message -- From: Alan alanwil...@gmail.com Date: Tue, Aug 3, 2010 at 12:25 AM Subject: Re: please, help with python 3.1 To: Chris Rebert c...@rebertia.com Sorry, I will explain. Well it looks like he

Re: please, help with python 3.1

2010-08-03 Thread Steven D'Aprano
:28:04 -0700, Chris Rebert wrote: -- Forwarded message -- From: Alan alanwil...@gmail.com Date: Tue, Aug 3, 2010 at 12:25 AM Subject: Re: please, help with python 3.1 To: Chris Rebert c...@rebertia.com Sorry, I will explain. I am using for a task 'find /' expecting

Re: please, help with python 3.1

2010-08-03 Thread Alan Wilter Sousa da Silva
: Alan alanwil...@gmail.com Date: Tue, Aug 3, 2010 at 12:25 AM Subject: Re: please, help with python 3.1 To: Chris Rebert c...@rebertia.com Sorry, I will explain. Well it looks like he forgot to post the traceback! -- http://mail.python.org/mailman/listinfo/python-list -- Alan

Re: please, help with python 3.1

2010-08-03 Thread Antoine Pitrou
On Tue, 3 Aug 2010 10:28:49 +0100 Alan Wilter Sousa da Silva awil...@ebi.ac.uk wrote: Now with python3.1: time python3.1 timout.py PID: 27687 Timed out! Process 27687 killed, max exec time (5s) exceeded Traceback (most recent call last):

Please Help

2010-07-14 Thread Hayathms
PLease anyone help me ,, program not running from tkinter import ttk from tkinter import * class Hami(ttk.Frame): def __init__(self,master=None):

Re: Please Help

2010-07-14 Thread Gary Herron
On 07/14/2010 01:51 PM, Hayathms wrote: PLease anyone help me ,, program not running from tkinter import ttk from tkinter import * class Hami(ttk.Frame): def __init__(self,master=None):

Re: pyreadline: default editable input; please, help.

2010-06-13 Thread Tim Roberts
rbenit68 rbeni...@gmail.com wrote: I would like to run this minimal example: I get the prompt (Question?), but not the 'default editable signal'. Please ¿any hints? (Windows XP-SP3, Python 2.6, pyreadline 1.5) PyReadline on Windows is not identical to readline on Linux, in part because the

pyreadline: default editable input; please, help.

2010-06-12 Thread rbenit68
I would like to run this minimal example: I get the prompt (Question?), but not the 'default editable signal'. Please ¿any hints? (Windows XP-SP3, Python 2.6, pyreadline 1.5) import readline def input_default(prompt, default): def startup_hook(): readline.insert_text(default)

Re: PLEASE HELP--Button images refuse to show.

2010-04-22 Thread Gabriel Genellina
En Mon, 19 Apr 2010 12:58:16 -0300, Barrett barrett@gmail.com escribió: I have been fighting the same bug for weeks now with zero success: I am trying to get images to come up on my buttons, but they are way too small. Regardless of whether I used my old Python 2.5.1 or now 2.6.5, the

PLEASE HELP--Button images refuse to show.

2010-04-19 Thread Barrett
I have been fighting the same bug for weeks now with zero success: I am trying to get images to come up on my buttons, but they are way too small. Regardless of whether I used my old Python 2.5.1 or now 2.6.5, the following code: '''Minesweeper.''' from Tkinter import *

newbie with a encoding question, please help

2010-04-01 Thread Mister Yu
hi experts, i m new to python, i m writing crawlers to extract data from some chinese websites, and i run into a encoding problem. i have a unicode object, which looks like this u'\xd6\xd0\xce\xc4' which is encoded in gb2312, but i have no idea of how to convert it back to utf-8 to re-create

Re: newbie with a encoding question, please help

2010-04-01 Thread Chris Rebert
2010/4/1 Mister Yu eryan...@gmail.com: hi experts, i m new to python, i m writing crawlers to extract data from some chinese websites, and i run into a encoding problem. i have a unicode object, which looks like this u'\xd6\xd0\xce\xc4' which is encoded in gb2312, No! Instances of type

Re: newbie with a encoding question, please help

2010-04-01 Thread Mister Yu
On Apr 1, 7:22 pm, Chris Rebert c...@rebertia.com wrote: 2010/4/1 Mister Yu eryan...@gmail.com: hi experts, i m new to python, i m writing crawlers to extract data from some chinese websites, and i run into a encoding problem. i have a unicode object, which looks like this

Re: newbie with a encoding question, please help

2010-04-01 Thread Chris Rebert
On Thu, Apr 1, 2010 at 4:38 AM, Mister Yu eryan...@gmail.com wrote: On Apr 1, 7:22 pm, Chris Rebert c...@rebertia.com wrote: 2010/4/1 Mister Yu eryan...@gmail.com: hi experts, i m new to python, i m writing crawlers to extract data from some chinese websites, and i run into a encoding

Re: newbie with a encoding question, please help

2010-04-01 Thread Stefan Behnel
Mister Yu, 01.04.2010 13:38: i m still not very sure how to convert a unicode object ** u'\xd6\xd0\xce\xc4 ** back to 中文 the string it supposed to be? You are confused. '\xd6\xd0\xce\xc4' is an encoded byte string, not a unicode string. The fact that you have it stored in a unicode string

Re: newbie with a encoding question, please help

2010-04-01 Thread Mister Yu
On Apr 1, 8:13 pm, Chris Rebert c...@rebertia.com wrote: On Thu, Apr 1, 2010 at 4:38 AM, Mister Yu eryan...@gmail.com wrote: On Apr 1, 7:22 pm, Chris Rebert c...@rebertia.com wrote: 2010/4/1 Mister Yu eryan...@gmail.com: hi experts, i m new to python, i m writing crawlers to extract

Re: newbie with a encoding question, please help

2010-04-01 Thread Stefan Behnel
Mister Yu, 01.04.2010 14:26: On Apr 1, 8:13 pm, Chris Rebert wrote: gb2312_bytes = ''.join([chr(ord(c)) for c in u'\xd6\xd0\xce\xc4']) unicode_string = gb2312_bytes.decode('gb2312') utf8_bytes = unicode_string.encode('utf-8') #as you wanted Simplifying this hack a bit: gb2312_bytes =

Re: newbie with a encoding question, please help

2010-04-01 Thread Mister Yu
On Apr 1, 9:31 pm, Stefan Behnel stefan...@behnel.de wrote: Mister Yu, 01.04.2010 14:26: On Apr 1, 8:13 pm, Chris Rebert wrote: gb2312_bytes = ''.join([chr(ord(c)) for c in u'\xd6\xd0\xce\xc4']) unicode_string = gb2312_bytes.decode('gb2312') utf8_bytes = unicode_string.encode('utf-8')

Need bluez/python ( PyBluez) method to access BlueZ data- Please Help!

2010-03-02 Thread Isaac
Hi, I need to access data that is handled and stored in the BlueZ file system, but is, unfortunately, not available via the current BlueZ D-Bus API. That is, the data I need is parsed by BlueZ, but not provided in the current D-Bus signal. I need a method or interface that does not rely on

hi can any one please help me..

2010-02-15 Thread chiranjeevi muttoju
- What is that error. if any body know please help me.. thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: hi can any one please help me..

2010-02-15 Thread Alf P. Steinbach
- What is that error. if any body know please help me.. thank you. It means the compiler can't find the python2.6 library; it's not in any of the directories where gcc searches for libraries. You can specify (additional) directories where gcc should search

Re: hi can any one please help me..

2010-02-15 Thread steve
Hello, On 02/15/2010 02:20 PM, chiranjeevi muttoju wrote: Hi, when i'm installing the pytc(python wrapper for tokyo cabinet.) i'm getting the fallowing error.. i'm getting this error for python2.6 only.. for python 2.4 its working fine.. - running

Re: Please help with MemoryError

2010-02-14 Thread Steve Holden
rantingrick wrote: On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven

Re: Please help with MemoryError

2010-02-14 Thread Steve Howell
On Feb 14, 10:32 am, Steve Holden st...@holdenweb.com wrote: rantingrick wrote: On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote:

Re: Please help with MemoryError

2010-02-14 Thread Steve Howell
On Feb 11, 5:50 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 11 Feb 2010 15:39:09 -0800, Jeremy wrote: My Python program now consumes over 2 GB of memory and then I get a MemoryError.  I know I am reading lots of files into memory, but not 2GB worth. 2.    

Re: Please help with MemoryError

2010-02-13 Thread rantingrick
On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit :

Re: Please help with MemoryError

2010-02-12 Thread Tim Chase
Aahz wrote: Tim Chase python.l...@tim.thechases.com wrote: Just to add to the mix, I'd put the anydbm module on the gradient between using a file and using sqlite. It's a nice intermediate step between rolling your own file formats for data on disk, and having to write SQL since access is

Re: Please help with MemoryError

2010-02-12 Thread Aahz
In article mailman.2426.1265976954.28905.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: Aahz wrote: Tim Chase python.l...@tim.thechases.com wrote: Just to add to the mix, I'd put the anydbm module on the gradient between using a file and using sqlite. It's a nice

Re: Please help with MemoryError

2010-02-12 Thread Jeremy
On Feb 11, 6:50 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 11 Feb 2010 15:39:09 -0800, Jeremy wrote: My Python program now consumes over 2 GB of memory and then I get a MemoryError.  I know I am reading lots of files into memory, but not 2GB worth. Are you

Re: Please help with MemoryError

2010-02-12 Thread Tim Chase
Aahz wrote: Not quite. One critical difference between dbm and dicts is the need to remember to save changes by setting the key's valud again. Could you give an example of this? I'm not sure I understand what you're saying. Well, you're more likely to hit this by wrapping dbm with shelve

Re: Please help with MemoryError

2010-02-12 Thread Steven D'Aprano
On Fri, 12 Feb 2010 06:45:31 -0800, Jeremy wrote: You also confirmed what I thought was true that all variables are passed by reference so I don't need to worry about the data being copied (unless I do that explicitly). No, but yes. No, variables are not passed by reference, but yes, you

Re: Please help with MemoryError

2010-02-12 Thread John Posner
On 2/12/2010 12:14 PM, Steven D'Aprano wrote: On Fri, 12 Feb 2010 06:45:31 -0800, Jeremy wrote: You also confirmed what I thought was true that all variables are passed by reference so I don't need to worry about the data being copied (unless I do that explicitly). No, but yes. No,

Re: Please help with MemoryError

2010-02-12 Thread mk
John Posner wrote: http://effbot.org/zone/call-by-object.htm http://en.wikipedia.org/wiki/Evaluation_strategy [1] http://mail.python.org/pipermail/edu-sig/2008-May/008583.html Hmm how about call by label-value? That is, you change labels by assignment, but pass the value of the

<    1   2   3   4   5   6   7   8   >