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
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(u\u6d4b.log)
Suppose the file to open does
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
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'\u4e00' for example. If
I write
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 should be easy figuring out what
it means by just
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
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 can
watch how the it executes
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 sys-
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.
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 Class2:
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 integer,
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 characters converting them to an integer.
Once the characters
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,
reading the first few hex characters converting them to an integer
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, to
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
17 matches
Mail list logo