Re: [Tutor] accessing code for built in min()

2014-07-31 Thread ugajin
Thanks Raúl, T'was the latter two. -u -Original Message- From: Raúl Cumplido To: uga...@talktalk.net CC: tutor Sent: Thu, 31 Jul 2014 10:36 Subject: Re: [Tutor] accessing code for built in min() Are you asking for the source code? For the CPython implementation, PyPy, Iron

[Tutor] accessing code for built in min()

2014-07-31 Thread ugajin
How do I look at the code for a python built in function e.g. min()? Thanks I am running 2.7.8 on OSX ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] name error

2014-07-15 Thread ugajin
Thanks all, for your time and trouble spent on this issue.    There are other 2D packages around including; Shoebot, which runs Python 2.7 and is a rewrite of nodebox 1, and is said to be inspired by DrawBot and Shoes. However, its installation is not well documented (or straightforward). node

[Tutor] name error

2014-07-14 Thread ugajin
I am running nodebox 1 on OSX v10.6.8, which is an open source OSX Python, 2D data visualiser, and although not legacy, the software it isn't well supported. (see http://nodebox.net/code/index.php/Home for further info).  I believe nodebox 1, runs with Python 2.5    This may be too specialised

Re: [Tutor] masking library files

2014-04-10 Thread ugajin
I do have a Reply All command, but as in this case, there is no recipient other than myself to be included. Also, hitting the Reply All command seems to generate an alert warning message, when recipients include a mail-list address, and some mail list replies go to the mail-list as recipient ra

[Tutor] Fwd: masking library files

2014-04-10 Thread ugajin
But I must remember to cc tutor@python.org when replying to you. -Original Message- From: uga...@talktalk.net To: alan.ga...@btinternet.com Sent: Thu, 10 Apr 2014 13:15 Subject: Re: [Tutor] masking library files It is off, and I don't appear have an option to turn it on in plai

Re: [Tutor] masking library files

2014-04-10 Thread ugajin
-Original Message- From: uga...@talktalk.net To: tutor@python.org Sent: Thu, 10 Apr 2014 10:17 Subject: Re: [Tutor] masking library files -Original Message- From: Mark Lawrence To: tutor@python.org Sent: Thu, 10 Apr 2014 9:36 Subject: Re: [Tutor] masking library files O

Re: [Tutor] masking library files

2014-04-10 Thread ugajin
-Original Message- From: Mark Lawrence To: tutor@python.org Sent: Thu, 10 Apr 2014 9:36 Subject: Re: [Tutor] masking library files On 10/04/2014 02:20, uga...@talktalk.net wrote: > Please write in plain English if you want to be understood. > > > -Original Message- > Fr

Re: [Tutor] masking library files

2014-04-09 Thread ugajin
Please write in plain English if you want to be understood. -Original Message- From: Dave Angel To: tutor@python.org Sent: Thu, 10 Apr 2014 2:00 Subject: Re: [Tutor] masking library files uga...@talktalk.net Wrote in message: > ___ > T

[Tutor] masking library files

2014-04-09 Thread ugajin
Is it common for files saved to a working directory to 'mask' library files located in the Python framework? -A ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Fwd: for: how to skip items

2014-02-17 Thread ugajin
0, 9, 19, 29, 39, is not every 10th index If you want to output every 10th. index try: a100 = list(range(0,100,10)) for a in a100: print(a) -Original Message- From: Gabriele Brambilla To: python tutor Sent: Mon, 17 Feb 2014 16:06 Subject: [Tutor] for: how to ski

Re: [Tutor] recursive function example

2013-12-12 Thread ugajin
In a way, it may help to identify the issue def multiply(a,b) return a*b clearly returns the product of the two arguments, a and b I presume it returns a+a rather than b+b+b mult(a, b-1) also has two arguments. and rest takes the value of the two arguments, but I do not see an instruction to m

Re: [Tutor] recursive function example

2013-12-11 Thread ugajin
No, not really. mutl(3, 2) has two arguments rest = mult(a, b - 1) also has two arguments but it is passed to value as one argument. value = a + rest But, thanks anyway. -A -Original Message- From: Mark Lawrence To: tutor@python.org Sent: Wed, 11 Dec 2013 17:38 Subject: Re

Re: [Tutor] recursive function example

2013-12-11 Thread ugajin
Yes, it does :) The indents get messed up in my mail programme, but/and issue running first example, it returns 1: def sum_up_to(n): # 'res' for result because 'sum' is a Python builtin symbol res = 0 for i in range(1, n+1): res += i return res print(sum_up_to(9)) B

Re: [Tutor] recursive function example

2013-12-11 Thread ugajin
It is kind of you to take the trouble of trying to explain. I see the value assigned to rest on each iteration from the debugging script that I made, What I do not see is how? Clearly, a = 3, it is constant throughout each iteration, and if rest is equal to 3, then a + rest must be equal to 6.

Re: [Tutor] recursive function example

2013-12-11 Thread ugajin
-Original Message- From: Alan Gauld To: tutor@python.org Sent: Wed, 11 Dec 2013 0:29 Subject: Re: [Tutor] recursive function example On 10/12/13 14:48, uga...@talktalk.net wrote: >> Here is original code: >> def mult(a, b): >> if b == 0: >> return 0 >>

[Tutor] recursive function example

2013-12-10 Thread ugajin
I am looking at a simple recursive function, and oxymoron aside, I am having difficulty in seeing what occurs. I have tried adding some debug print commands to help break the thing down. This helps a lot, but I still have a question that I need help with. Here is original code: def mult(a, b):

[Tutor] running modules as scripts

2013-12-07 Thread ugajin
Thanks for your answers! Hmm! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] running modules as scripts

2013-12-05 Thread ugajin
I have some difficulty with the abovet. I succeeded after a fashion, but only after some experiment, and I am not satisfied that all is well. Here is the script code (as per the Python tutorial 6.1.1.): def fib(n):# write Fibonacci series up to n a, b = 0, 1 while b < n: prin

Re: [Tutor] empty delimiters, and None

2013-12-01 Thread ugajin
Well, yes. I find can indeed use;locale.setlocale(locale.LC_ALL) thanks! In addition to locale.setlocale(locale.LC_ALL, None) I found I can also use; locale.setlocale(locale.LC_ALL, 'en_GB') The question remains, why does; locale.setlocale(locale.LC_ALL, '') fail, especially if it is good pr

[Tutor] Fwd: empty delimiters, and None

2013-12-01 Thread ugajin
The answer is , yes (to both questions) locale -a does report availability of en_US (and en_US.UTF), C is supported, but C.UTF-8 does not appear in the list. I have tried inserting export LANG="en_GB.UTF.8" as a new line 127. Thanks. -A -Original Message- From: eryksun To: uga...@t

[Tutor] empty delimiters, and None

2013-11-30 Thread ugajin
Thanks for the helpful comments Eryksun/Steve Mis-configured environment (see below)? I rather felt that setting the 2nd parameter to None, was side stepping an underlying issue. However I experimented further and find; locale.setlocale(locale.LC_ALL, 'en_GB') also works OK. Perhaps this is a be

[Tutor] empty delimiters, and None

2013-11-29 Thread ugajin
I run Inkscape (an Open Source vector drawing application) on OSX (Snow leopard) installed via .dmg pkg. The application ships with a collection of Python extensions, one of which Measure Path, failed to execute. I could not find a reference for this issue in the Inkscape archives, and I trie