2004年09月01日 星期三 14:58
How to write some bytes into a opened file. For example: Define i = 20000, and the file object instance is fp, how to wirte i into fp? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20040901/a89f1241/attachment.html
2004年09月01日 星期三 15:24
import struct
fp.write(struct.pack('i', i))
----- Original Message -----
From: 王�| Oscar Wang <oscar at kinposh.com.cn>
Date: Wed, 1 Sep 2004 14:58:10 +0800
Subject: [python-chinese] About File operation
To: python-chinese at lists.python.cn
How to write some bytes into a opened file.
For example:
Define i = 20000, and the file object instance is fp, how to wirte i into fp?
_______________________________________________
python-chinese list
python-chinese at lists.python.cn
http://python.cn/mailman/listinfo/python-chinese
Zeuux © 2025
京ICP备05028076号