Re: how to match u'\uff00' - u'\uff0f' in re module?

2006-07-10 Thread yichao.zhang
MacDonald Thanks! John Now I know how silly a question that is ! However I'll be not so silly thanks to your help ! I'll follow your suggestions! That's very nice. -- http://mail.python.org/mailman/listinfo/python-list

how to match u'\uff00' - u'\uff0f' in re module?

2006-07-10 Thread yichao.zhang
I'm trying to match the characters from u'\uff00' to u'\uff0f'. the code below and get a TypeError. p = re.compile(u'\uff00'-u'\uff0f') Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode' so re module does NOT support th

writing some lines after reading goes wrong on windows?

2006-04-27 Thread yichao.zhang
Hi all I can not write anything if I have read something. the code as: Python 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] on win32 IDLE 1.1.3 >>> a=open('d:\\a','r+') >>> a >>> a.read() '11\n22\n33\n' >>> a.seek(0) >>> a.read(1) '1' >>> a.write("a") >>> a.seek(0) >>> a.read()