[Tutor] Need Explanation...

2011-12-09 Thread sunil tech
*hi,* * * *Consider a list: a = [1,2,3]* * * *& a simple function, which when called it will append 100 to the list.* * * *def app(x):* * return x.append(100)* * * *p = app(a)* * * *now list holds appended value [1,2,3,100]* *but p is empty... why it is?* * * *please teach.* ___

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Steven D'Aprano
Cranky Frankie wrote: From: Dave Angel <> Probably because I work in a shop that still heavily uses older languages like COBOL and CULPRIT where you still deal with labels, branching, goto, etc. The fact that it is possible to code "structured" that way AND the Python way amazes me. You have

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Steven D'Aprano
Cranky Frankie wrote: I appreciate all the comments in this thread so far, but what I'm really looking for is what to call the style of programming where you have no direct branching via line numbers, statement names, and gotos. Structured programming. I'm finding that lacking these things t

[Tutor] What style do you call Python programming?

2011-12-09 Thread Cranky Frankie
From: Dave Angel <> Probably because I work in a shop that still heavily uses older languages like COBOL and CULPRIT where you still deal with labels, branching, goto, etc. The fact that it is possible to code "structured" that way AND the Python way amazes me. -- Frank L. "Cranky Frankie"

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Dave Angel
On 12/09/2011 08:58 PM, Cranky Frankie wrote: I appreciate all the comments in this thread so far, but what I'm really looking for is what to call the style of programming where you have no direct branching via line numbers, statement names, and gotos. I'm finding that lacking these things that I

[Tutor] What style do you call Python programming?

2011-12-09 Thread Cranky Frankie
I appreciate all the comments in this thread so far, but what I'm really looking for is what to call the style of programming where you have no direct branching via line numbers, statement names, and gotos. I'm finding that lacking these things that I've been familiar with in other languages is goo

Re: [Tutor] how to handle big numbers

2011-12-09 Thread Steven D'Aprano
surya k wrote: Finding factorial of 8 or 9 isn't big. If I would like to find factorial of 32327, how can I ?? py> import math py> n = math.factorial(32327) # takes about 2 seconds on my computer py> s = str(n) # takes about 30 seconds py> len(s) 131744 py> print s[:10] + "..."

Re: [Tutor] attribute overwrite

2011-12-09 Thread Prasad, Ramit
>class DateTime(datetime.datetime): > def __init__(self, year, month, day, *args): >super().__init__() >if self.year >= 1000: > self.year = self.year % 1000 I have no idea how you could use the sample you have given (or why) but, this was actually a fun exercise that forced me to le

Re: [Tutor] attribute overwrite

2011-12-09 Thread rail shafigulin
On Fri, Dec 9, 2011 at 4:43 PM, rail shafigulin wrote: > i need to overwrite and attribute from the inherited class. i also need to > run the constructor of the super class. here is the code > > import datetime > > class DateTime(datetime.datetime): > def __init__(self, year, month, day, *args):

[Tutor] attribute overwrite

2011-12-09 Thread rail shafigulin
i need to overwrite and attribute from the inherited class. i also need to run the constructor of the super class. here is the code import datetime class DateTime(datetime.datetime): def __init__(self, year, month, day, *args): super().__init__(year, month, day, *args) if self.year >= 1

Re: [Tutor] Python Windows Vista Installation Question

2011-12-09 Thread Jerry Hill
On Fri, Dec 9, 2011 at 1:41 PM, Homme, James wrote: > Can Python easily be installed on a Windows Vista computer without needing > administrative rights to that machine? > I thought the standard installer worked for non-admin installs, as long as you select "Just for me" instead of "All users on

Re: [Tutor] Python Windows Vista Installation Question

2011-12-09 Thread Prasad, Ramit
>>Can Python easily be installed on a Windows Vista computer without needing >>administrative rights to that machine? >If you use portable python: http://www.portablepython.com/ that might work for >you. You can manually install python relatively easily without administrative rights. Although,

Re: [Tutor] how to handle big numbers

2011-12-09 Thread Robert Sjoblom
> There are other approaches that may bear looking at, like the SciPy library. >  But first we'd need to know just what you need with this factorial. Wouldn't a prime swing implementation be the absolutely fastest? Something like this: http://en.literateprograms.org/Special:Downloadcode/Factorials

Re: [Tutor] how to handle big numbers

2011-12-09 Thread Dave Angel
On 12/09/2011 03:04 PM, surya k wrote: Date: Fri, 9 Dec 2011 14:53:07 -0500 From: d...@davea.name To: sur...@live.com CC: tutor@python.org Subject: Re: [Tutor] how to handle big numbers On 12/09/2011 02:25 PM, surya k wrote: Finding factorial of 8 or

Re: [Tutor] Python Windows Vista Installation Question

2011-12-09 Thread Wayne Werner
On Fri, Dec 9, 2011 at 12:41 PM, Homme, James wrote: > Hi, > > Can Python easily be installed on a Windows Vista computer without needing > administrative rights to that machine? > > > If you use portable python: http://www.portablepython.com/ that might work for you. HTH, Wayne

Re: [Tutor] how to handle big numbers

2011-12-09 Thread surya k
> Date: Fri, 9 Dec 2011 14:53:07 -0500 > From: d...@davea.name > To: sur...@live.com > CC: tutor@python.org > Subject: Re: [Tutor] how to handle big numbers > > On 12/09/2011 02:25 PM, surya k wrote: > > Finding factorial of 8 or 9 isn't big. If I would l

Re: [Tutor] how to handle big numbers

2011-12-09 Thread Dave Angel
On 12/09/2011 02:25 PM, surya k wrote: Finding factorial of 8 or 9 isn't big. If I would like to find factorial of 32327, how can I ?? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] how to handle big numbers

2011-12-09 Thread Alan Gauld
On 09/12/11 19:25, surya k wrote: Finding factorial of 8 or 9 isn't big. If I would like to find factorial of 32327, how can I ?? Just type it in, but expect to wait a long time for the answer... Python integers are limited by the memory of your machi

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Alan Gauld
On 09/12/11 19:24, Alan Gauld wrote: In February 1991, after just over a year of development, I decided to post to USENET. The rest is in the Misc/HISTORY file. = Hopefully that clarifies rather than condfusing! :-) The HISTORY file gives more detail still. Hmm, I

Re: [Tutor] Python and Tkinter (total newbie)

2011-12-09 Thread Alan Gauld
On 09/12/11 19:03, Richard Lyons wrote: I have tried to enter the first sample program from p. 19 in Grayson: Python and Tkinter Programming. When I run the program I get an error as follows: Traceback (most recent call last): File "/home/dick/Desktop/calc1.py", line 50, in if _name_ == '_main_

[Tutor] how to handle big numbers

2011-12-09 Thread surya k
Finding factorial of 8 or 9 isn't big. If I would like to find factorial of 32327, how can I ?? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mail

Re: [Tutor] Python and Tkinter (total newbie)

2011-12-09 Thread Dave Angel
On 12/09/2011 02:03 PM, Richard Lyons wrote: I have tried to enter the first sample program from p. 19 in Grayson: Python and Tkinter Programming. When I run the program I get an error as follows: Traceback (most recent call last): File "/home/dick/Desktop/calc1.py", line 50, in if _name_

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Alan Gauld
On 09/12/11 15:36, Sarma Tangirala wrote: Where does it say that python was originally not designed to be scripted? If thats the case then I agree my comment was completely incorrect. I read somewhere that it was designed so. It was designed as a "scripting language" but not for the purpose of

[Tutor] Python and Tkinter (total newbie)

2011-12-09 Thread Richard Lyons
I have tried to enter the first sample program from p. 19 in Grayson: Python and Tkinter Programming. When I run the program I get an error as follows: Traceback (most recent call last): File "/home/dick/Desktop/calc1.py", line 50, in if _name_ == '_main_': NameError: name '_name_' is not d

[Tutor] Python Windows Vista Installation Question

2011-12-09 Thread Homme, James
Hi, Can Python easily be installed on a Windows Vista computer without needing administrative rights to that machine? Thanks. Jim Jim Homme, Usability Services, Phone: 412-544-1810. This e-mail and any attachments to it are confidential and are intended solel

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Sarma Tangirala
On 9 December 2011 21:44, Steven D'Aprano wrote: > Sarma Tangirala wrote: > > The point is its a scripted language. >> > > Define "scripted language". (Scripting language?) > > > I meant scripting language. :) > > Most of what you want to do should be >> about a line. Python is derived from t

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Steven D'Aprano
Sarma Tangirala wrote: The point is its a scripted language. Define "scripted language". (Scripting language?) Most of what you want to do should be about a line. Python is derived from the idea of scripted languages wherein constructs like loops and functions were added for more control.

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Steven D'Aprano
Cranky Frankie wrote: I'm looking for a term to call the kind of Python programming that Python is, in other words, programming with no branching, no GOTOs, no statement labels and no line numbers. I'm tempted to call it Structured Progamming, but we had that in COBOL, and this is not like COBOL.

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Sarma Tangirala
On 9 December 2011 20:50, Dario Lopez-Kästen wrote: > On Fri, Dec 9, 2011 at 3:54 PM, Sarma Tangirala > wrote: > >> >> On 9 December 2011 20:07, Cranky Frankie wrote: >> >>> I'm looking for a term to call the kind of Python programming that >>> >>> <...snip...> > >> >>> >> The keyword you are lo

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Dario Lopez-Kästen
On Fri, Dec 9, 2011 at 3:54 PM, Sarma Tangirala wrote: > > On 9 December 2011 20:07, Cranky Frankie wrote: > >> I'm looking for a term to call the kind of Python programming that >> >> <...snip...> > >> > The keyword you are looking for is 'programming paradigm' and python > implements several a

Re: [Tutor] What style do you call Python programming?

2011-12-09 Thread Sarma Tangirala
On 9 December 2011 20:07, Cranky Frankie wrote: > I'm looking for a term to call the kind of Python programming that > Python is, in other words, programming with no branching, no GOTOs, no > statement labels and no line numbers. I'm tempted to call it > Structured Progamming, but we had that in

[Tutor] What style do you call Python programming?

2011-12-09 Thread Cranky Frankie
I'm looking for a term to call the kind of Python programming that Python is, in other words, programming with no branching, no GOTOs, no statement labels and no line numbers. I'm tempted to call it Structured Progamming, but we had that in COBOL, and this is not like COBOL. It seems to be with Py

[Tutor] Help with update_wrapper

2011-12-09 Thread Emeka
Hello All, Could someone explain " functools.update_wrapper" with simple examples? Regards, Janus -- *Satajanus Nig. Ltd * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinf