Re: [Tutor] First realscript + Game of Life

2006-11-10 Thread Luke Paireepinart
> But probably (surely) my interpretation is wrong. Hehe > Ah, well, it's just the terminology you were using was a bit misleading. You say ' Hey Rooy, so its possible to copy binary numbers from memory?' All his function does is converts an integer (that's in memory, yes) into a binary number

Re: [Tutor] Some sample code: review?

2006-11-10 Thread Kent Johnson
Danny Yoo wrote: > 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: Hi Danny, This looks very clean to me. It is surprisingly complex but I don't see how to make it simpler. S

Re: [Tutor] Some sample code: review?

2006-11-10 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote >> def register(self, handler): >> """register: (object (object -> string) -> string or None) > > Maybe it's just me but I don't have a clue what 'object (object -> > string)' is trying to convey. This might be an interesting test of the leg

[Tutor] __init__.py for running a file from commandline?

2006-11-10 Thread Marcus Goldfish
Hoping someone can help with this...I have a logical python namespace using a directory tree and __init__.py files.  For example, PYTHONPATH points to ~pyroot, and I have the following:~pyroot/~pyroot/utils/ ~pyroot/utils/commands/mygrep.pyWhich makes it nice to code:# some python scriptimport util

Re: [Tutor] __init__.py for running a file from commandline?

2006-11-10 Thread Luke Paireepinart
Marcus Goldfish wrote: > Hoping someone can help with this... > > I have a logical python namespace using a directory tree and > __init__.py files. For example, PYTHONPATH points to ~pyroot, and I > have the following: > > ~pyroot/ > ~pyroot/utils/ > ~pyroot/utils/commands/mygrep.py > > Which ma

[Tutor] SAX, DOM, XSLT api

2006-11-10 Thread Picio
Hello, what are the equivalent Pyhton tools you suggest to handle: SAX DOM and which api for XSLT ? I know that this is a really newbie question...But I'm a true python newbie ;) ! Daniele P.s: I know I can also google-it a little bit to find those answers but your advices are better. __

Re: [Tutor] First realscript + Game of Life

2006-11-10 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Luke Paireepinart > Sent: Friday, November 10, 2006 12:08 AM > To: Carlos > Cc: tutor@python.org > Subject: Re: [Tutor] First realscript + Game of Life > > > > > Since there has been some talk about

Re: [Tutor] SAX, DOM, XSLT api

2006-11-10 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Picio > Sent: Friday, November 10, 2006 8:03 AM > To: tutor@python.org > Subject: [Tutor] SAX, DOM, XSLT api > > Hello, > what are the equivalent Pyhton tools you suggest to handle: > SAX > DOM > >

Re: [Tutor] Windows Registry

2006-11-10 Thread Ryan Wilson
>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

[Tutor] winsound mac

2006-11-10 Thread max .
i am starting a small useless program i got from the show lost but cant find a module on mac to make beeping noises i know windows has winsound *never used it but heard about it* but eather way is thair anything like winsound for mac ^_^" s33 y4 _

Re: [Tutor] winsound mac

2006-11-10 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of max . > Sent: Friday, November 10, 2006 9:01 AM > To: tutor@python.org > Subject: [Tutor] winsound mac > > i am starting a small useless program i got from the show > lost but cant find > a module

Re: [Tutor] Some sample code: review?

2006-11-10 Thread Danny Yoo
> Some of the names and comments are confusing, I've commented below. > Other than that it looks good to me. >> def __init__(self, default_str=str, >> recursive_str=lambda obj, dstr: "..."): > > What are the arguments to default_str? Ah, good. I should document that

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

2006-11-10 Thread doug shawhan
I'm having some difficulties with elementtree as well. I'm attempting to parse a fairly sizeable xml file (it's the ebay "category tree" report. I've cached a copy at http://www.crackrabbit.com/misc/CatTree.xml). 900K or so! :-) For some reason I'm unable to read any elements from the file. I hav

[Tutor] TimedRotatingFileHandler donot rollover

2006-11-10 Thread viktor vraniak
hallo i have (i thing) little problem with TimedRotatingFileHandler i have following code to get mylogger: def MyLogger(req, logpath, logfilename): logdir = DEFAULT_LOG_DIR backupcount = DEFAULT_LOG_BACKUPS fmt='%(asctime)s %(msecs)d %(levelname)-8s %(message)s' da

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

2006-11-10 Thread doug shawhan
Ah. Apparently, the string xmlns="urn:ebay:apis:eBLBaseComponents" is causing some sort of outfreakage. I'm not well versed in xml lore: is the "urn:" tag out of context here? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

[Tutor] Second attempt convert DateTimeTyep to datetime.datetime

2006-11-10 Thread johnf
Hi, I'm using FreeTDS (MS SQL database access lib) and for datetime fields it returns a type 'DateTimeType'. I need it in type 'datetime.datetime'. There is very little in the form of a tutorial that explains what I need to do. Can someone help me with this issue. John

Re: [Tutor] winsound mac

2006-11-10 Thread Alan Gauld
"max ." <[EMAIL PROTECTED]> wrote >i am starting a small useless program i got from the show lost but >cant find > a module on mac to make beeping noises I think you can make a Terminal window beep printing the standard ASCII beep character (Ctrl-G?) But the real way to control sound on the Ma

Re: [Tutor] Second attempt convert DateTimeTyep to datetime.datetime

2006-11-10 Thread Luke Paireepinart
johnf wrote: > Hi, > > I'm using FreeTDS (MS SQL database access lib) and for datetime fields it > returns a type 'DateTimeType'. I need it in type 'datetime.datetime'. There > is very little in the form of a tutorial that explains what I need to do. > if a datetimetype object has a __str_

Re: [Tutor] winsound mac

2006-11-10 Thread Luke Paireepinart
> Finally, does pygame exist for Macs? If so it has > some sound features. > yep, yep. Pygame has mac support. You can use numeric arrays to generate various different sounds. It also has support for playing midi, mp3, ogg, etc. At least in some cases it does. > HTH, > > Alan G. > > > ___

[Tutor] Syntax when using classes question.

2006-11-10 Thread Chris Hengge
is the following dummycode good practice? Or pythonic? or what? I'm just curious because there are several ways I've found to use libraries and classes...Method 1:from lib import classlib().class(param1, param2) Method 2: (C Style?)from lib import classmyClass = class()myLib.class(param1, param2)Th

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

2006-11-10 Thread Terry Carroll
On Thu, 9 Nov 2006, Chris Hengge wrote: > I've been trying to look for a roadmap or something from them that would > show estimated product release dates. Does this not exist? I sent an email to Trent Mick at Activestate and asked if they had an ETA (and ended with "you guys aren't dropping Pytho

Re: [Tutor] Syntax when using classes question.

2006-11-10 Thread Luke Paireepinart
Chris Hengge wrote: > is the following dummycode good practice? Or pythonic? or what? I'm > just curious because there are several ways I've found to use > libraries and classes... > > Method 1: > from lib import class > lib().class(param1, param2) I don't know what you're doing here but I think

Re: [Tutor] Some sample code: review?

2006-11-10 Thread Danny Yoo
> I should, though, rephrase the signature as: > >register: object str_function -> string or None > > to be more readable. Separately, I can then define that a 'str_function' is > a callable that takes anything and turns it into a string. Ok, I made those changes. I've also fixed a very sil

Re: [Tutor] Syntax when using classes question.

2006-11-10 Thread Luke Paireepinart
Chris Hengge wrote: > As for saving memory.. I'm not particularily concerned since all my > systems have 2gb... > Also, before python I was writing C# database front ends (nothing > amazing) and I'm not even going to compare python's 10mb overhead to > .net's 45mb+. I was mostly just curious if