[Tutor] Frozen Binaries

2005-05-30 Thread Chuck Allison
Hello tutor, Could someone please give me the quick lowdown on creating frozen binaries? Thanks. -- Best regards, -- Chuck Allison ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] File Input of "Objects"

2005-06-01 Thread Chuck Allison
;out.dat','w') >>> print >> f, 1, 2 >>> f.close() >>> s = open('out.dat').read() >>> x,y = tuple(map(eval,s.split()[:2])) >>> x,y (1, 2) This is just what came to mind w

[Tutor] Word COM interface

2005-06-09 Thread Chuck Allison
Hello, Does anyone know how to get the Microsoft Word 11.0 Object library working in ActiveState Python 2.4.1? When I go into PythonWin and try to load it under makePy, I get the following error: >>> Generating to >>> C:\Python24\lib\site-packages\win32com\gen_py\00020905---C000-

Re: [Tutor] Python Books

2005-06-12 Thread Chuck Allison
Hello Terry, Practical Python is really good too, although I chose Learning Python over it to teach my class this month. Sunday, June 12, 2005, 9:00:34 AM, you wrote: TC> On Sun, 12 Jun 2005, Kristiano Ang wrote: >> So, I'm prepared to invest in a Python book of some sort that will >> help me

Re: [Tutor] Popen4 and Paths Containing Spaces

2005-06-15 Thread Chuck Allison
Hello Hugo, Wednesday, June 15, 2005, 12:20:37 PM, you wrote: HGM> This problem is explained there. Also, why are you using those forward HGM> slashes in your Windows paths Meaning: d:/program HGM> files/winzip/wzzip.exe Windows doesn't care. The only place you can't use forward slashes i

Re: [Tutor] A newbie question about running python scripts

2005-06-15 Thread Chuck Allison
Hence, the question. === -- Chuck Allison ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Every Other

2005-06-19 Thread Chuck Allison
Hello Tutors, What would be the most Pythonic way of printing (or extracting) every other element of a list? Thanks in advance. -- Chuck Allison ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class vs. Static Methods

2005-06-21 Thread Chuck Allison
Sorry for the elementary question: I was wondering if someone could explain the difference to me between class and static methods. Coming from other languages, I'm used to static methods, but not "class methods". Thanks. -- Best regards, Chuck ___ Tut

Re: [Tutor] Class vs. Static Methods

2005-06-21 Thread Chuck Allison
see a need for class methods (even after reading Martelli's Nutshell). I understand the syntax issues - I just don't see the need yet. Tuesday, June 21, 2005, 3:28:48 PM, you wrote: C> On Tue, 21 Jun 2005 16:52:09 -0400, Chuck Allison wrote C> (in article <[EMAIL PROTECTED]>):

Re: [Tutor] Class vs. Static Methods

2005-06-22 Thread Chuck Allison
This is a neat trick. But can't this also be done with a static method that accesses a static data attribute the same way? Alan G wrote: >>class Shape(object): >> _count = 0 >> >> @classmethod >> def count(cls): >>try: >> cls._count += 1 >>except AttributeError: >> cls

Re: [Tutor] Class vs. Static Methods

2005-06-22 Thread Chuck Allison
Hello Kent, This is the killer example I've been looking for. Now I understand. Sorry I've been so dense. This is way cool. Thanks. Wednesday, June 22, 2005, 4:39:38 AM, you wrote: KJ> Not sure why you think you have to write a new classmethod for KJ> each shape. Suppose you want to maintain cre

Re: [Tutor] Interesting problem

2005-06-28 Thread Chuck Allison
I may be missing something, but isn't this what __dict__ does? Just return self.__dict__. This is an old message, so this may have mentioned already. Sorry if that's the case. I'm a little behind. Kent Johnson wrote: >Smith, Jeff wrote: > > >>Here would be the usage: >> >>myinst = MyClass() >

Re: [Tutor] String to List and back?

2005-07-02 Thread Chuck Allison
Hello Chinook, How about join(), as in ''.join(strlist) ? Saturday, July 2, 2005, 9:45:28 PM, you wrote: C> I'm missing something simple again. The simplified issue is: C> Python 2.4.1 (#2, Mar 31 2005, 00:05:10) C> >>> mystr = 'abc' C> # I can create a list of the string characters C>

Re: [Tutor] OT python Licences

2005-07-12 Thread Chuck Allison
Hello Sandip, Tuesday, July 12, 2005, 10:38:09 AM, you wrote: SB> Dave S wrote: >> This is a bit OT but here goes. >> >> My work wants me to write a fairly large python script to analyze some >> technical ASCII data files. Python and its libraries are GPL. >> >> That being the case am I right i

Re: [Tutor] [Edu-sig] nice()

2006-02-13 Thread Chuck Allison
There is a reliable way to compute the exact number of floating-point "intervals" (one less than the number of FP numbers) between any two FP numbers. It is a long-ago solved problem. I have attached a C++ version. You can't define closeness by a "distance" in a FP system - you should use this