Hello, I was recently learning python decorator and descriptor and
emulated a @classmethod decorator:
class EmuClassMethod(object):
def __init__(self, f=None):
self.f = f
def __get__(self, obj, klass=None):
if klass is None:
klass = type(obj)
def wrapped(
Ben Sizer wrote:
> I've installed several different versions of Python across several
> different versions of MS Windows, and not a single time was the Python
> directory or the Scripts subdirectory added to the PATH environment
> variable. Every time, I've had to go through and add this by hand,
gonzlobo wrote:
> I've been using Python for a few days. It's such the perfect language
> for parsing data!
>
> I really like it so far, but I'm having a hard time reading a file,
> reading the first few hex characters & converting them to an integer.
> Once the characters are converted to an inte
WaterWalk wrote:
> gonzlobo wrote:
> > I've been using Python for a few days. It's such the perfect language
> > for parsing data!
> >
> > I really like it so far, but I'm having a hard time reading a file,
> > reading the first few hex characte
WaterWalk wrote:
> WaterWalk wrote:
> > gonzlobo wrote:
> > > I've been using Python for a few days. It's such the perfect language
> > > for parsing data!
> > >
> > > I really like it so far, but I'm having a hard time reading a file,
Pyenos wrote:
> Approach 1:
>
> class Class1:
> class Class2:
> def __init__(self):self.variable="variable"
>
> class Class3:
> def method():print Class1().Class2().variable #problem
>
> Approach 1.1:
>
> class Class1:
> class
I've just read an article "Building Robust System" by Gerald Jay
Sussman. The article is here:
http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf
In it there is a footprint which says:
"Indeed, one often hears arguments against building exibility into an
engineered sy
Hello. When I tried to make Tkinter canvas widget respond to
MouseWheel event on Windows XP, I failed. The canvas just doesn't
receive MouseWheel event. I used bind_all to find out which widget
receives this event and the result showed that only the top Tk widget
gets it. This is really annoying.
Hello. I wonder what's the effective way of figuring out how a piece
of python code works. With C I often find it very useful to be able to
run the code in step mode and set breakpoints in a debugger so I can
watch how the it executes, how the data change and how the code jumps
from one function to
On Mar 17, 11:54 am, WaterWalk <[EMAIL PROTECTED]> wrote:
> Hello. I wonder what's the effective way of figuring out how a piece
> of python code works. With C I often find it very useful to be able to
> run the code in step mode and set breakpoints in a debugger so I ca
On Mar 17, 1:54 pm, Stargaming <[EMAIL PROTECTED]> wrote:
> On Sun, 16 Mar 2008 20:54:01 -0700, WaterWalk wrote:
> > Hello. I wonder what's the effective way of figuring out how a piece of
> > python code works.
>
> If your Python code is well-written, it shoul
Until Python 2.5, the exception object still uses ansi string. Thus,
in the following example:
f = open(u"\u6d4b.log")
Suppose the file to open does not exist, the output message of the
exception maybe like:
[Errno 2] No such file or directory: u'\u6d4b.log'
This is not a clear message.
I fina
On Oct 9, 9:46 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Thu, 9 Oct 2008 06:37:04 -0700 (PDT), WaterWalk <[EMAIL PROTECTED]> wrote:
> >Until Python 2.5, the exception object still uses ansi string. Thus,
> >in the following example:
>
> >f = open(
Hello. Consider the following two examples:
class Test1(object):
att1 = 1
def func(self):
print Test1.att1// ok
class Test2(object):
att1 = 1
att2 = Test2.att1 // NameError: Name Test2 is not defined
It seems a little strange. Why a class name can be used in a method
Ah, I see. Thank you all.
--
http://mail.python.org/mailman/listinfo/python-list
Hello. I just found on Windows when an exception is raised and
traceback info is printed on STDERR, all the characters printed are
just plain ASCII. Take the unicode character u'\u4e00' for example. If
I write:
print u'\u4e00'
If the system locale is "PRC China", then this statement will print
th
On Apr 3, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> WaterWalk wrote:
> > Hello. I just found on Windows when an exception is raised and
> > traceback info is printed on STDERR, all the characters printed are
> > just plain ASCII. Take the unicode character u
17 matches
Mail list logo