Re: [Tutor] code improvement for beginner ?

2005-10-08 Thread Danny Yoo
On Sat, 8 Oct 2005, lmac wrote: > Ok. Here we go. Wanted to start my page long ago. Now is the right time. > > http://daderoid.freewebspace24.de/python/python1.html Hi lmac, I'll pick out some stuff that I see; I'm sure others will be happy to give comments too. I'll try to make sure that all

Re: [Tutor] FW: FW: Is it Posible? To Crack And HowTo [horribly OT]

2005-10-08 Thread Daniel Watkins
> Really? I was of the impression that proprietory code developers *ate* > small children. Goes to show, can't believe everything you read on > Slashdot. I heard that they write all their programs using the blood of cute-looking puppies (though how that doesn't short-circuit anything I'd like to

Re: [Tutor] handling of tabular data

2005-10-08 Thread Danny Yoo
On Sat, 8 Oct 2005, [ISO-8859-1] Frank Hoffs�mmer wrote: > I often find myself writing python programs to compute averages, min, > max, top10 etc of columns in a table of data In these programs, I always > capture each row of the table in a tuple the table is then represented > by a list of tupl

Re: [Tutor] FW: Is it Posible? To Crack And HowTo

2005-10-08 Thread Liam Clarke
> > On a good day the fun of creating all those licenses lets me sleep with a > smile on my face. On a bad day, I have nightmares about all the hungry > children caused by my greed. ;-) Really? I was of the impression that proprietory code developers *ate* small children. Goes to show, can't bel

[Tutor] handling of tabular data

2005-10-08 Thread Frank Hoffsümmer
Hello I often find myself writing python programs to compute averages, min, max, top10 etc of columns in a table of data In these programs, I always capture each row of the table in a tuple the table is then represented by a list of tuples computing averages, min, max and other meta-information i

Re: [Tutor] subclass problem: __names and type-checking

2005-10-08 Thread Alan Gauld
> If B inherits from A then every context where A or an A instance appears > should work correctly with B or a B instance. Since the B constructor > *requires* more arguments, it violates that ideal. In other words, it > would be OK to allow additional arguments. It is not OK to require > them.

Re: [Tutor] code improvement for beginner ?

2005-10-08 Thread lmac
Ok. Here we go. Wanted to start my page long ago. Now is the right time. http://daderoid.freewebspace24.de/python/python1.html Thank you. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] AttributeError: 'str' object has no attribute 'geturl'

2005-10-08 Thread Javier Ruere
Joseph Quigley wrote: > Well, I'm back to coding more on my comic downloader and viewer and I > keep getting this error: > > Traceback (most recent call last): > File "F:\Gacor\getgarf.py", line 244, in ? > getImg(Data.todayStrip) > File "F:\Gacor\getgarf.py", line 127, in getImg > Da

[Tutor] AttributeError: 'str' object has no attribute 'geturl'

2005-10-08 Thread Joseph Quigley
Well, I'm back to coding more on my comic downloader and viewer and I keep getting this error: Traceback (most recent call last):   File "F:\Gacor\getgarf.py", line 244, in ?     getImg(Data.todayStrip)   File "F:\Gacor\getgarf.py", line 127, in getImg     Data.f.geturl() AttributeError: 'str' obj

Re: [Tutor] is there any Python code for spatial tessellation?

2005-10-08 Thread Danny Yoo
On Sat, 8 Oct 2005, Shi Mu wrote: > is there any Python code for spatial tessellation? Are you looking for code to generate voronoi diagrams? http://en.wikipedia.org/wiki/Voronoi_diagram >From initial Google searches, it appears that there is a package called Qhull that pepole use to do V

Re: [Tutor] code improvement for beginner ?

2005-10-08 Thread Danny Yoo
On Sat, 8 Oct 2005, lmac wrote: > i wonder if i could post some of my scripts and anyone can tell me if > there is a better way for coding the problem. In the way of some > teaching class. ;-) Sure, that's perfectly fine. If the script is very large, you may want to post it on the web and sen

[Tutor] code improvement for beginner ?

2005-10-08 Thread lmac
Hi there, i wonder if i could post some of my scripts and anyone can tell me if there is a better way for coding the problem. In the way of some teaching class. ;-) Or is this mailing-list only for specific questions ? Thanks. ___ Tutor maillist - Tu

Re: [Tutor] Opening files, finding their location

2005-10-08 Thread Scott Oertel
Christopher Arndt wrote: Scott Oertel schrieb: I'm looking for an easy way to find the current directory location of my program so I can include the config.ini file correctly without having to pass command line args. So, do you want to find out, where your script is li

[Tutor] Listing all of an instances variables

2005-10-08 Thread Python
def report(self): for i in dir(self): # use the getattr function print getattr(self, i) -- Lloyd Kvam Venix Corp ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] subclass problem: __names and type-checking

2005-10-08 Thread Python
Traceback (most recent call last): File "C:/Python24/foofoofoo.py", line 26, in -toplevel- s2 = Sub2() File "C:/Python24/foofoofoo.py", line 22, in __init__ super(Sub2, self).__init__() File "C:/Python24/foofoofoo.py", line 10, in __init__ if type(self) == __TwoUnderBase: #

[Tutor] subclass problem: __names and type-checking

2005-10-08 Thread Python
I think that a sub-class *needs* to support the same programming interface as the parent class. Bertrand Meyer has written about programming by contract and the implications for object oriented design. http://archive.eiffel.com/doc/oosc/ http://se.ethz.ch/~meyer/ If B inherits from A then every c

Re: [Tutor] Listing all of an instances variables

2005-10-08 Thread Karl Pflästerer
On 8 Okt 2005, [EMAIL PROTECTED] wrote: > Class SomeClass: >def __init__(self,a,b): > self.a = a > self.b = b > >def report(self): > for i in dir(self): > print self.i > > > > > This is where I run into problems: How do I return all of the variables > in an in

Re: [Tutor] subclass problem: __names and type-checking

2005-10-08 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-10-08 07:08: > Brian van den Broek wrote: >> >>Here's a sketch of where I'm at: >>class _BaseClass(object): >> >> def __init__(self, arg1, arg2): >> self.arg1 = arg1 >> self.arg2 = arg2 >> if type(self) == _BaseClass: >>

Re: [Tutor] Opening files, finding their location

2005-10-08 Thread Christopher Arndt
Scott Oertel schrieb: > I'm looking for an easy way to find the current directory location of my > program so I can include the config.ini file correctly without having to > pass command line args. So, do you want to find out, where your script is living, or the directory from which it was calle

[Tutor] Listing all of an instances variables

2005-10-08 Thread Matt Williams
Dear List, I'm stuck on trying to write a generic 'report' function: Class SomeClass: def __init__(self,a,b): self.a = a self.b = b def report(self): for i in dir(self): print self.i This is where I run into problems: How do I return all of the varia

Re: [Tutor] Did anyone get the Kamaelia "Conversing" chapter 5 to work?

2005-10-08 Thread R. Alan Monroe
> On Friday 07 October 2005 03:04, R. Alan Monroe wrote: > That's great to hear - not the oversight part but the fact you were talking > about your work. Out of interest, how did you find the tutorial/exercises and > what level of experience would you say you have? Around 2-3 years with Python. Bu

[Tutor] Opening files, finding their location

2005-10-08 Thread Scott Oertel
I have a small problem with one of my scripts currently, I'm using the config parser to open a config.ini file, but this program is going to be designed to be used as a cron job, currently i made a work around.. ./program.py config.ini is how you run it from the command line I'm looking for an

Re: [Tutor] subclass problem: __names and type-checking

2005-10-08 Thread Kent Johnson
Brian van den Broek wrote: > I have a class which I want to subclass. The subclass adds some > additional arguments to __init__. I want both classes to run a sanity > check on their arguments before leaving their respective __init__ > methods. I need both to do so, as the _BaseClass may be directly

Re: [Tutor] [Fwd: Re: Consistant Overhead Byte Stuffing (COBS)algorithm help]

2005-10-08 Thread Kent Johnson
Michael Cotherman wrote: > The c code seems to be walking through the list moving > bytes from src to dst, but the python code below seems > to take one byte from src, start counitng up to the > value from 1 and appending each and every value along > the way to dst, no? Ah, right you are. You are

[Tutor] is there any Python code for spatial tessellation?

2005-10-08 Thread Shi Mu
is there any Python code for spatial tessellation? thanks a lot!   ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 20, Issue 26: New Python Book

2005-10-08 Thread Matt Williams
IMHO, as regards the book using wxPython, rather than Tkinter: I've failed to get Tkinter to compile on several installs, whereas I can usually get wxPython to work. Also, wx seems to be better documented.I know it's not ideal to pick one platform, but I would guess that wx would be a reason