Re: [Tutor] which is faster

2014-06-10 Thread Steven D'Aprano
On Tue, Jun 10, 2014 at 09:57:51PM +0530, diliup gabadamudalige wrote:
> Thank you very much for the links. I will install this module, time the two
> code snippets and then share the info. Thank you very much!

You're welcome, but there is no need to install the timeit module, it is 
part of the standard library that is pre-installed with every Python 
since version 2.3 (about eleven years ago).



-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] which is faster

2014-06-10 Thread William Ray Wing
On Jun 10, 2014, at 2:42 AM, diliup gabadamudalige  wrote:

> Hi All,
> 
> This is a Pygame related question and if not answered it's ok and I apologise 
> for asking. But if someone can answer it is much appreciated.
> 
> In Pygame Which is faster?
> 
> 1. filling the screen with a colour
> or
> 2. blitting an image to screen
> 
> Thank you for the time.
> May you be well.
> 
> 
> -- 
> Diliup Gabadamudalige
> 

I don’t use Pygame, but it seems to me the answer is likely to depend on what 
graphics hardware is available on the computer in question.

-Bill



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] which is faster

2014-06-10 Thread Steven D'Aprano
On Tue, Jun 10, 2014 at 12:12:56PM +0530, diliup gabadamudalige wrote:

> In Pygame Which is faster?
> 
> 1. filling the screen with a colour
> or
> 2. blitting an image to screen


Why don't you time it and find out? Don't forget to come back and report 
what you discover, I'm sure I'm not the only one who would like to know 
the answer to the question.

http://pymotw.com/2/timeit/

More information here:

https://docs.python.org/2/library/timeit.html



-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] which is faster

2014-06-10 Thread Alan Gauld

On 10/06/14 07:42, diliup gabadamudalige wrote:

Hi All,

This is a Pygame related question and if not answered it's ok and I
apologise for asking. But if someone can answer it is much appreciated.

In Pygame Which is faster?

1. filling the screen with a colour
 or
2. blitting an image to screen


My guess is blitting, but it is only a guess.
You'd be much better off asking the pygame community on
the pygame forum/list

HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor