Re: how to get the path of a module (myself) ?

2009-06-15 Thread jh
Stef Mientki gmail.com> writes: > I don't seem to have pkg_utils, > only pkgutil, which doesn't have an apropiate function. > > But I found another way, don't know if that's reliable: > import inspect > print inspect.currentframe().f_code.co_filenameE Eeek. > head -999 foo/* ==> foo/__init__.py

Is type object an instance or class?

2007-02-26 Thread JH
Hi I found that a type/class are both a subclass and a instance of base type "object". It conflicts to my understanding that: 1.) a type/class object is created from class statement 2.) a instance is created by "calling" a class object. A object should not be both a class and an instance at the

Regular Expression pattern group

2006-06-14 Thread JH
Hi I am a fussy learner. Could someone explain to me why the following inconsistency exists between methods? How can it be justified if it is considered all right? There are three groups in pattern. However, match object shows 3 groups in collection, but group has to be indexed from one because t

__cmp__ method

2006-06-14 Thread JH
Hi Can anyone explain to me why the following codes do not work? I want to try out using __cmp__ method to change the sorting order. I subclass the str and override the __cmp__ method so the strings can be sorted by the lengh. I expect the shortest string should be in the front. Thanks >>> class

Re: Python IDE

2004-12-28 Thread David JH
On the subject can somebody here who uses SPE (or just has some python knowledge) help me out with the installation process? I tried following http://spe.pycs.net/extra/manual/manual.html#windows but end up with the error: python /c/system/python24/Lib/site-packages/_spe/winInstall.py Traceb

Re: Python IDE

2004-12-28 Thread David JH
On the subject can somebody here who uses SPE (or just has some python knowledge) help me out with the installation process? I tried following http://spe.pycs.net/extra/manual/manual.html#windows but end up with the error: python /c/system/python24/Lib/site-packages/_spe/winInstall.py Traceb