Python论坛  - 讨论区

标题:[python-chinese] About File operation

2004年09月01日 星期三 14:58

=?GB2312?B?zfWsfCBPc2NhciBXYW5n?= oscar at kinposh.com.cn
Wed Sep 1 14:58:10 HKT 2004

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

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年09月01日 星期三 15:24

Qiangning Hong hongqn at gmail.com
Wed Sep 1 15:24:33 HKT 2004

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


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号