[Tutor] Movement controls useing pygame

2010-03-19 Thread mark-ireland
A little stuck and could do with any sudjestions. Aim:- When the character goes past the middle of the screen, the background level move downwards so the character can get to higher places, think sonic the hedgehog. This is the bit I'm having problems with, I can get the character to get to

Re: [Tutor] Movement controls useing pygame

2010-03-19 Thread Luke Paireepinart
Are you just reposting this exact same e-mail to the list because you didn't see my reply to the other one, or are you ignoring what I said and posting the same message again, hoping someone else will answer? I hope it's not the latter, that's kind of insulting. The least you could do is say that

Re: [Tutor] movement controls

2010-03-19 Thread Luke Paireepinart
On Fri, Mar 19, 2010 at 4:09 AM, sne...@msn.com wrote: But yes, I'm not quite sure about what you mean. I guess you mean keep the character on the x plane then for the jumping movements move the level? what do you mean by 'You should probably decouple the view from the model' and

[Tutor] difflib context to string-object?

2010-03-19 Thread Karjer Jdfjdf
With difflib.context_diff it is possible to write the context to files. difflib.context_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm]) Is it also possible to do this to seperate string-objects instead of writing them to files?

[Tutor] using pythnn to open a password protected website

2010-03-19 Thread richard west
Hi, Im trying to use python to open up a password protected website(e.g. facebook / gmail) in Firefox. supplying the login and password automatically at runtime - so that I can interface my code with fingerprint recognition code. So far I have only found urllib, urllib2 and web browser, none of

Re: [Tutor] using pythnn to open a password protected website

2010-03-19 Thread Wayne Werner
On Fri, Mar 19, 2010 at 7:33 AM, richard west richardbw...@gmail.comwrote: Hi, Im trying to use python to open up a password protected website(e.g. facebook / gmail) in Firefox. supplying the login and password automatically at runtime - so that I can interface my code with fingerprint

Re: [Tutor] difflib context to string-object?

2010-03-19 Thread bob gailer
On 3/19/2010 6:55 AM, Karjer Jdfjdf wrote: With difflib.context_diff it is possible to write the context to files. difflib.context_diff(/a/, /b/[, /fromfile/][, /tofile/][, /fromfiledate/][, /tofiledate/][, /n/][, /lineterm/]) Is it also possible to do this to seperate string-objects instead

Re: [Tutor] Understanding (Complex) Modules

2010-03-19 Thread Wayne Watson
(I meant to post this to both the list and Steven back a week or so ago. I missed the list, so am posting it here now. Unfortunately, I'm again in a position where I cannot respond for several days, but I will be back early next week to examine some posts that followed this.)

[Tutor] Efficiency and speed

2010-03-19 Thread James Reynolds
Hello all: I've still been working towards learning the language, albeit slowly and I've been working on a project that is somewhat intense on the numerical calculation end of things. Running 10,000 trials takes about 1.5 seconds and running 100,000 trials takes 11 seconds. Running a million

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Stefan Behnel
James Reynolds, 19.03.2010 17:41: I've still been working towards learning the language, albeit slowly and I've been working on a project that is somewhat intense on the numerical calculation end of things. Running 10,000 trials takes about 1.5 seconds and running 100,000 trials takes 11

Re: [Tutor] parsing a chunked text file

2010-03-19 Thread Karim Liateni
Hello, Thanks both of you for these useful information. Regards Karim Hugo Arts wrote: On Thu, Mar 18, 2010 at 12:54 PM, Stefan Behnel stefan...@behnel.de wrote: Karim Liateni, 04.03.2010 01:23: Yes, a *big* difference in the true sense of the word. Your code (assuming you meant to write

Re: [Tutor] Efficiency and speed

2010-03-19 Thread James Reynolds
Well, I'm always out to impress! This is a monte-carlo simulation. The simulation measures the expiration of something and those somethings fall into bins that are not evenly dispersed. These bins are stored in the nx list mentioned previously. So let's say you have the bins, a, b,c,d,e,f and

Re: [Tutor] using pythnn to open a password protected website

2010-03-19 Thread Alan Gauld
richard west richardbw...@gmail.com wrote Im trying to use python to open up a password protected website(e.g. facebook / gmail) in Firefox. So you are trying to control Firefox not the web site? Is that correct? What mechanism are you using to communicate with Firefox? code. So far I

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Emile van Sebille
On 3/19/2010 9:41 AM James Reynolds said... snipped and reformatted OK, so starting here: def mcrange_gen(self, sample): lensample = len(sample) nx2 = self.nx1 nx2_append = nx2.append nx2_sort = nx2.sort nx2_reverse = nx2.reverse nx2_index = nx2.index nx2_remove =

[Tutor] Tutorial executable from python script.

2010-03-19 Thread Karim Liateni
Hello, I want to do a executable for linux/unix from python scripts and thus o allow to run on machine which doesn't have recent version (2.0) of python. I found the compile() method but how can I use it to make all in one executable which could be run on old system (old python). If you

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Alan Gauld
James Reynolds eire1...@gmail.com wrote I've made a few other optimizations today that I won't be able to test until I get home, but I was wondering if any of you could give some general pointers on how to make python run a little more quickly. Always, always, get the algorithm efficient

Re: [Tutor] Tutorial executable from python script.

2010-03-19 Thread Alan Gauld
Karim Liateni karim.liat...@free.fr wrote on machine which doesn't have recent version (2.0) of python. Given that v2 is at least 10 years old now that's not really recent I'd be surprised if any current Linux distros had anything that old on them! Even the ones designed for old hardware.

Re: [Tutor] Efficiency and speed

2010-03-19 Thread James Reynolds
Here's another idea I had. I thought this would be slower than then the previous algorithm because it has another for loop and another while loop. I read that the overhead of such loops is high, so I have been trying to avoid using them where possible. def mcrange_gen(self, sample):

Re: [Tutor] difflib context to string-object?

2010-03-19 Thread Steven D'Aprano
On Fri, 19 Mar 2010 09:55:06 pm Karjer Jdfjdf wrote: With difflib.context_diff it is possible to write the context to files. difflib.context_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm]) Is it also possible to do this to seperate string-objects instead of

Re: [Tutor] using pythnn to open a password protected website

2010-03-19 Thread Steven D'Aprano
On Fri, 19 Mar 2010 11:33:36 pm richard west wrote: Hi, Im trying to use python to open up a password protected website(e.g. facebook / gmail) in Firefox. supplying the login and password automatically at runtime - so that I can interface my code with fingerprint recognition code. So far I

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Luke Paireepinart
On Fri, Mar 19, 2010 at 3:17 PM, James Reynolds eire1...@gmail.com wrote: Here's another idea I had. I thought this would be slower than then the previous algorithm because it has another for loop and another while loop. I read that the overhead of such loops is high, so I have been trying to

Re: [Tutor] Efficiency and speed

2010-03-19 Thread Alan Gauld
James Reynolds eire1...@gmail.com wrote Here's another idea I had. I thought this would be slower than then the previous algorithm because it has another for loop and another while loop. I read that the overhead of such loops is high, so I have been trying to avoid using them where