含有章节索引的 *PUG 文章通用模板 ::-- ZoomQuiet [2008-03-03 15:18:17]

CPUG联盟::

CPUG::门户plone

BPUG

SPUG

ZPUG

SpreadPython Python宣传

1. 文件编码问题~通解

   1 f = file(...)
   2 t = open(..,'w')
   3 t.write(f.read())

For simple pass-through read-write, why not use binary mode? --

   1 # Note: just for illustration, this naive approach breaks when
   2 # the input file is larger than your physical memory
   3 fp = open('input', 'rb')
   4 tp = open('output', 'wb')
   5 tp.write(fp.read())

Jerry

MiscItems/2008-03-03 (last edited 2009-12-25 07:15:15 by localhost)