Re: [Tutor] First realscript + Game of Life

2006-11-09 Thread Carlos
Hi, > What? > I think you're talking to someone else here, cause I have no idea what > you mean. > Copy binary numbers from memory? > You mean from any arbitrary memory location you want? > That sounds a lot like C++ pointers to me. That was based on this: > Hi Carlos, > I hope this module wou

Re: [Tutor] Looking for some constructive peer review.

2006-11-09 Thread Chris Hengge
Yeah, I'm trying to hold out on gui stuff at the moment. I'm trying to get a grasp on classes and threads at the moment because nothing I've made to date in python really calls for anything outside of what a console can offer. Kinda keeping it simple for now I guess... I'll probably rebuild this ap

Re: [Tutor] pygame rpg

2006-11-09 Thread Luke Paireepinart
federico ramirez wrote: > Hi! im trying to make a rpg game with pygame, of ocurse i will first > to try make simpler games, anyways, i could not find any good > tutorial, example, article, not anything about making a rpg with > pygame and the documentations is pretty poor... only some tutorials

Re: [Tutor] pygame rpg

2006-11-09 Thread Luke Paireepinart
federico ramirez wrote: > Hi! im trying to make a rpg game with pygame, of ocurse i will first > to try make simpler games, anyways, i could not find any good > tutorial, example, article, not anything about making a rpg with > pygame and the documentations is pretty poor... only some tutorials

Re: [Tutor] First realscript + Game of Life

2006-11-09 Thread Luke Paireepinart
Carlos wrote: > Hallo to All, > > Hey Rooy, so its possible to copy binary numbers from memory? I had > the impression that this could be done, but obviously it is too much > for me. This way is going to be faster than the hack that I tried > before, right? Thanks for the module : ) What? I thi

Re: [Tutor] Looking for some constructive peer review.

2006-11-09 Thread Luke Paireepinart
Chris Hengge wrote: > I write this little IM style client the other night based on some > sample socket and threading examples I found plus a little of my own > twist just to make it more interesting.. > I'd like some constructive peer review just to help me make sure I'm > doing this correctly

Re: [Tutor] Looking for some constructive peer review.

2006-11-09 Thread Chris Hengge
Oops... I started another sentence at the end, then ended up on the phone and forgot what I was doing and hit send Now I dont remember the other bug.. Oh well.. Thanks again.On 11/9/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I write this little IM style client the other night based on some sa

[Tutor] Looking for some constructive peer review.

2006-11-09 Thread Chris Hengge
I write this little IM style client the other night based on some sample socket and threading examples I found plus a little of my own twist just to make it more interesting.. I'd like some constructive peer review just to help me make sure I'm doing this correctly / well. You can test it by connec

[Tutor] datetimetype vs datetime.datetime

2006-11-09 Thread johnf
Hi I'm working on a python interface to freetds. And freetds can access MS SQL database engines. But I'm having trouble with datatime datatypes. The python module I'm using is MSSQL.py written back in 2003. After getting it compiled access to MS SQL works if I stay with simple datatypes (in

[Tutor] Can you help me with Elementtree (fwd)

2006-11-09 Thread Danny Yoo
Forwarding to tutor. Please don't email tutor questions directly to me, but do share them with the group instead. I don't want to shoulder the obligation of answering your question on my own; I'd rather share that with a support group like Tutor. See: http://catb.org/esr/faqs/smart-ques

[Tutor] pygame rpg

2006-11-09 Thread federico ramirez
Hi! im trying to make a rpg game with pygame, of ocurse i will first to try make simpler games, anyways, i could not find any good tutorial, example, article, not anything about making a rpg with pygame and the documentations is pretty poor... only some tutorials Well, i was wondering is someone ca

Re: [Tutor] Which is the latest version of Python for windows

2006-11-09 Thread Chris Hengge
I've been trying to look for a roadmap or something from them that would show estimated product release dates. Does this not exist?On 11/9/06, Terry Carroll <[EMAIL PROTECTED]> wrote:On Thu, 9 Nov 2006, Simon Brunning wrote: > On 11/9/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:> > I am so sorr

Re: [Tutor] First realscript + Game of Life

2006-11-09 Thread Carlos
Hallo to All, Hey Rooy, so its possible to copy binary numbers from memory? I had the impression that this could be done, but obviously it is too much for me. This way is going to be faster than the hack that I tried before, right? Thanks for the  module : ) Now I'm tring to implement a Conwa

Re: [Tutor] Which is the latest version of Python for windows

2006-11-09 Thread Terry Carroll
On Thu, 9 Nov 2006, Simon Brunning wrote: > On 11/9/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > > I am so sorry to disturb you. I hope u dont mind. > > I cannot find the version 2.5 for Active Python. Activestate is still on 2.4.3. I'm awaiting a 2.5 version of ActivePython, myself. You

Re: [Tutor] Help with Elementtree ...how to access the attributes..

2006-11-09 Thread Gabriel Farrell
On Fri, Nov 10, 2006 at 10:23:49AM +1300, John Fouhy wrote: > On 10/11/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > > I am trying to parse XML documents using elementtree. > > I have just started with it. Can somebody help me with how to select nodes > > with a particular atribute set to some

Re: [Tutor] Help with Elementtree ...how to access the attributes..

2006-11-09 Thread Gabriel Farrell
On Thu, Nov 09, 2006 at 06:23:50PM +, Asrarahmed Kadri wrote: > Hi Folks, > > > I am trying to parse XML documents using elementtree. > I have just started with it. Can somebody help me with how to select nodes > with a particular atribute set to some value. For example, I have the > followin

Re: [Tutor] Help with Elementtree ...how to access the attributes..

2006-11-09 Thread John Fouhy
On 10/11/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > I am trying to parse XML documents using elementtree. > I have just started with it. Can somebody help me with how to select nodes > with a particular atribute set to some value. For example, I have the > following file. Now I want to acces

[Tutor] Some sample code: review?

2006-11-09 Thread Danny Yoo
Hi everyone, I wrote up some sample code to make a more extensible str()-like function. I'd like some comments before putting it up onto the Python Cookbook: # class DeepStr: """Deep stringifier.""" def __init__(self,

Re: [Tutor] Tuple and Dicts?

2006-11-09 Thread Kent Johnson
Basil Shubin wrote: > Hi friends! > > Imagine the tuple that has dictionaries as it's item: > print data > ({'id': 0, 'title': 'Linux'}, {'id': 1, 'title': 'FreeBSD'}) > > How I can get index of tuple item where dict's key 'id' equal to > appropriate value? And can this be done without 'for

Re: [Tutor] Tuple and Dicts?

2006-11-09 Thread Jason Massey
How about something like:>>> data = "" 0, 'title': 'Linux'}, {'id': 1, 'title': 'FreeBSD'})>>> id = 0>>> result = [x for x in data if x['id'] == id][{'id': 0, 'title': 'Linux'}] >>> result = [x for x in data if x['id'] == id]>>> result[0]{'id': 0, 'title': 'Linux'}>>> You get the entire dict entry

[Tutor] Help with Elementtree ...how to access the attributes..

2006-11-09 Thread Asrarahmed Kadri
Hi Folks,     I am trying to parse XML documents using elementtree. I have just started with it. Can somebody help me with how to select nodes with a particular atribute set to some value. For example, I have the following file. Now I want to access the founder element of the company whose attribu

[Tutor] Tuple and Dicts?

2006-11-09 Thread Basil Shubin
Hi friends! Imagine the tuple that has dictionaries as it's item: >>> print data ({'id': 0, 'title': 'Linux'}, {'id': 1, 'title': 'FreeBSD'}) How I can get index of tuple item where dict's key 'id' equal to appropriate value? And can this be done without 'for' loops, just in one string? -- Bas

Re: [Tutor] Calling instance method using a string

2006-11-09 Thread Bernard Lebel
Thanks everyone for the advice. Bernard On 11/9/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > >> Say I have class A: > >> > >> class A: > >> def myMethod( self ): > >> print 'foo' > >> > >> a = A() > > > > getattr(a, 'myMethod')() > > > > The getattr() call gets the bound method, the

Re: [Tutor] Ruby Code Blocks vs. Python Lambdas

2006-11-09 Thread Carroll, Barry
Hello, John > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Fouhy > Sent: Tuesday, November 07, 2006 6:56 PM > To: Carroll, Barry > Cc: tutor@python.org > Subject: Re: [Tutor] Ruby Code Blocks vs. Python Lambdas > > On 08/11/06, Carroll, Barry <[E

Re: [Tutor] Request - please join the list to post

2006-11-09 Thread Danny Yoo
On Thu, 9 Nov 2006, Kent Johnson wrote: > Tim Johnson wrote: >> On a related note, every time I post, I get some kind of advisory >> email back that is worded as if this is the first time I've posted. >> (I've been on this list for close to 6 years).. >> Not exactly spam, but not necessa

Re: [Tutor] Calling instance method using a string

2006-11-09 Thread Danny Yoo
>> Say I have class A: >> >> class A: >> def myMethod( self ): >> print 'foo' >> >> a = A() > > getattr(a, 'myMethod')() > > The getattr() call gets the bound method, the extra parentheses at the > end call it. Hi Bernard, You can also do this in a controlled manner by treating the

Re: [Tutor] [spam-spf] Re: Request - please join the list to post

2006-11-09 Thread Tim Johnson
* Kent Johnson <[EMAIL PROTECTED]> [061109 07:46]: > Tim Johnson wrote: > > On a related note, every time I post, I get some kind of advisory > > email back that is worded as if this is the first time I've posted. > > (I've been on this list for close to 6 years).. > > Not exactly spam, but no

Re: [Tutor] Request - please join the list to post

2006-11-09 Thread Kent Johnson
Tim Johnson wrote: > On a related note, every time I post, I get some kind of advisory > email back that is worded as if this is the first time I've posted. > (I've been on this list for close to 6 years).. > Not exactly spam, but not necessary. > tj I think you will get one of those eve

Re: [Tutor] Windows Registry

2006-11-09 Thread Christopher Arndt
Todd Dahl schrieb: > I am currently working on a project that in a small part of it I need to > find keys in the windows registry. I have found _winreg but was > wondering if anyone knows of any modules that people have written as a > wrapper for it. I have googled like crazy but am not finding any

Re: [Tutor] Request - please join the list to post

2006-11-09 Thread Tim Johnson
On a related note, every time I post, I get some kind of advisory email back that is worded as if this is the first time I've posted. (I've been on this list for close to 6 years).. Not exactly spam, but not necessary. tj -- let's see if I get one from this -- * Kent Johnson <[EMAIL PR

Re: [Tutor] Which is the latest version of Python for windows

2006-11-09 Thread Simon Brunning
On 11/9/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > I am so sorry to disturb you. I hope u dont mind. > I cannot find the version 2.5 for Active Python. http://www.google.com/search?q=python+2.5+windows+download > Is it possible to use two versions at the same time..?? Yup. Install however

Re: [Tutor] Calling instance method using a string

2006-11-09 Thread Kent Johnson
Bernard Lebel wrote: > Hello, > > Is there a way to call an instance method using a string? Let say I > have the method name in the form of a string, and I want to call this > method by providing the string instead of calling the name directly. > Is this possible? > > Say I have class A: > > cla

Re: [Tutor] Questions about PIL

2006-11-09 Thread Luke Paireepinart
Chris Hengge wrote: > Yes, I understand what a loop is, and there was a loop but I didn't > write that code into my email because I didn't need commenting on it. > Here is the code so its clear incase you really care =P Just because you don't need commenting on it doesn't mean it's not relevant. E

Re: [Tutor] Questions about PIL

2006-11-09 Thread Luke Paireepinart
Chris Hengge wrote: > What I want to do with the data shouldn't really matter. I'm not > completely sure what I want to do with the image data anyways, but for > sake of arguement everything is happening in memory at this point, so > 'objects' is correct. Images start in memory, and are being ev

[Tutor] Calling instance method using a string

2006-11-09 Thread Bernard Lebel
Hello, Is there a way to call an instance method using a string? Let say I have the method name in the form of a string, and I want to call this method by providing the string instead of calling the name directly. Is this possible? Say I have class A: class A: def myMethod( self ): p

Re: [Tutor] Windows Registry

2006-11-09 Thread Kent Johnson
Todd Dahl wrote: > I am currently working on a project that in a small part of it I need to > find keys in the windows registry. I have found _winreg but was > wondering if anyone knows of any modules that people have written as a > wrapper for it. pyRegistry maybe? http://jbox.ultraemail.net:8

[Tutor] Windows Registry

2006-11-09 Thread Todd Dahl
I am currently working on a project that in a small part of it I need to find keys in the windows registry. I have found _winreg but was wondering if anyone knows of any modules that people have written as a wrapper for it. I have googled like crazy but am not finding anything. What I trying to do

Re: [Tutor] Which is the latest version of Python for windows

2006-11-09 Thread Simon Brunning
On 11/9/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > Hi Folks, > > Can someone tell me which is teh latest version of Python on windows > platform? Version 2.5 -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ ___ Tuto

[Tutor] Which is the latest version of Python for windows

2006-11-09 Thread Asrarahmed Kadri
Hi Folks,   Can someone tell me which is teh latest version of Python on windows platform?   TIA.   Best Regards, Asrarahmed Kadri-- To HIM you shall return. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Request - please join the list to post

2006-11-09 Thread Kent Johnson
Recently there have been a number of replies to the list from people who are not subscribed. I suppose they are from people who read the list on gmane.org or some other web archive rather than receiving it through email. Each of these replies requires a list administrator (usually me) to log on

Re: [Tutor] First real script

2006-11-09 Thread Hieu Hoang
Hi Carlos, I hope this module would help you with the binary conversion part: def tobits(inte,size = 3): """Copy an integer's bits from memory""" s='' for i in range(size): s += str((inte & (1<>i) #bits are extracted right-to-left s = s[::-1] #reverse the result string

Re: [Tutor] Questions about PIL

2006-11-09 Thread Kent Johnson
Chris Hengge wrote: > alist = difference(image1,image2) > a = [b for b in alist.getdata() if b != (0,0,0)] > if len(a) != 0: >print "Not the same" > > is much slower then (9x) > > if im1.tostring() != im2.tostring() >print "something changed!" One reason the second version will be fa

Re: [Tutor] Questions about PIL

2006-11-09 Thread Chris Hengge
What I want to do with the data shouldn't really matter. I'm not completely sure what I want to do with the image data anyways, but for sake of arguement everything is happening in memory at this point, so 'objects' is correct. Images start in memory, and are being evaluated in memory, never writte

Re: [Tutor] Questions about PIL

2006-11-09 Thread Chris Hengge
Yes, I understand what a loop is, and there was a loop but I didn't write that code into my email because I didn't need commenting on it. Here is the code so its clear incase you really care =Pfrom PIL import Image from PIL import ImageGrabimport timecapturedFrames = 100count = 0print "\nInitializi

Re: [Tutor] Drawing simple graphics objects

2006-11-09 Thread Luke Paireepinart
> > from graphics import * > > def main(): > > win = GraphWin() > shape = Rectangle(Point(50,50), Point(20,20)) > shape.setOutline("red") > shape.setFill("red") > shape.draw(win) > for i in range(10): gui What's this mysterious 'gui' floating out here? > p = win.get