[Tutor] Timing a python program

2015-01-16 Thread CL Talk
Hello - I have a python program that reads data from data files and does manipulation on the data and writes back to output files. I am developing this program on a macbook with python 2.7.6. This program takes close to 10 minutes on my machine to run. But, the issue is that it is not take the sam

Re: [Tutor] Timing a python program

2015-01-16 Thread Ben Finney
CL Talk writes: > I am trying to see how I can time the whole program as well as various > functions that are part of the program. The term for this dynamic timing introspection of parts of the system is “program profiling”; you are seeking a “profiler” https://en.wikipedia.org/wiki/Profiling_%2

Re: [Tutor] Timing a python program

2015-01-16 Thread Alan Gauld
On 16/01/15 05:02, CL Talk wrote: I am trying to see how I can time the whole program as well as various functions that are part of the program. That's called profiling and there is a Python profiler. Here's the official doc page https://docs.python.org/2/library/profile.html And here's th

Re: [Tutor] Timing a python program

2015-01-16 Thread Mark Lawrence
On 16/01/2015 08:52, Alan Gauld wrote: On 16/01/15 05:02, CL Talk wrote: I am trying to see how I can time the whole program as well as various functions that are part of the program. That's called profiling and there is a Python profiler. Here's the official doc page https://docs.python.o

Re: [Tutor] Improving My Simple Game Code for Speed, Memory and Learning

2015-01-16 Thread WolfRage
On 01/12/2015 04:47 PM, Mark Lawrence wrote: I haven't looked carefully at your code but there's always a smell in Python when you see structure[x][y]. Can you change the grid so you always write something like:- for row in grid: for cell in row: process(cell) I say this as I'm

Re: [Tutor] Timing a python program

2015-01-16 Thread Alan Gauld
On 16/01/15 09:20, Mark Lawrence wrote: https://docs.python.org/2/library/profile.html For non Luddites https://docs.python.org/3/library/profile.html :) Yeah, but the OP said it was for 2.7.6 on a Mac... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www

Re: [Tutor] Tutor Digest, Vol 131, Issue 38

2015-01-16 Thread bw_dw
> Hello, > I'm new the the group and new to programming in Python. > Snipped.. > Sincere thanks > d > From: Emile van Sebille > Check out http://it-ebooks.info/book/172/ > Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

Re: [Tutor] Tutor Digest, Vol 131, Issue 38

2015-01-16 Thread bw_dw
THANKS EMILE!!! I downloaded the e-book and am having fun with it!! Much appreciate :-] > > Hello, > > I'm new the the group and new to programming in Python. > > Snipped.. > > Sincere thanks > > d > > > From: Emile van Sebille > > Check out http://it-ebooks.info/book/172/ > > Emile _

Re: [Tutor] Timing a python program

2015-01-16 Thread Albert-Jan Roskam
On Fri, Jan 16, 2015 7:34 PM CET Alan Gauld wrote: >On 16/01/15 09:20, Mark Lawrence wrote: > >> https://docs.python.org/2/library/profile.html >> >> For non Luddites https://docs.python.org/3/library/profile.html :) > > >Yeah, but the OP said it was for 2.7.6 on a Ma

Re: [Tutor] Timing a python program

2015-01-16 Thread Danny Yoo
On Thu, Jan 15, 2015 at 9:02 PM, CL Talk wrote: > Hello - I have a python program that reads data from data files and > does manipulation on the data and writes back to output files. I am > developing this program on a macbook with python 2.7.6. > > This program takes close to 10 minutes on my mac

[Tutor] menu based programs

2015-01-16 Thread Siya 360
Hi, Am still learning Python, and i have been tasked with writing a used menu, where once session is initialised by user inputing a used code e.g. *123#, it displays menu to user with option i want to learn how to write code to interact with the user, in a sequence where if option 1, then disp

Re: [Tutor] menu based programs

2015-01-16 Thread Alan Gauld
On 16/01/15 23:39, Siya 360 wrote: i want to learn how to write code to interact with the user, > in a sequence where > if option 1, then display a, > if 2 then display b, > if 3 display c, > if 4 display exit, if 1 selected, leads to option a, which in turn has it own options You don't say