2006年09月12日 星期二 11:47
ée¡ëÞ¯*'xÛh²Ö«µªk¢ ÚØ^¦º ©§yçm¡·¬zÛayéïº'éí½ªâj{_»-ºÈ§üÚÛ-j»b¶Ø^ë" r¶'¶±rë^¶¢iÚk¢øyÖò¶©®+jaèÂÚ¢Øb°¦ºÈ§)©¢»h²Åç/zÊ&z;«jËhvaƧv+p¢¹,×h²Ö«¶Æî·Z´Ø¬²Ú+zØ^¢ëiºØ§iø¥{bë¬x)ÊØh'z-±ç*.¶¶§ÁÓ0µ.m§ÿéÊØhÉÿ¦*^®f¢úr¶'r§zÇ¿jÛZrÛ?ÛM:ÓÝvÿ]ñý¹oöµ§!éíÙ¥
2006年09月12日 星期二 12:09
On 9/12/06, xhsoldier <xhsoldier在163.com> wrote: > I am using > import os > os.execve(some paras) to do this, and it works, it do starts > but what I want is: store the output in a file while using python i can not > see any output see subprocess module pls. good luck.
2006年09月12日 星期二 12:20
有一个二进制的bit文件,想把他的内容转化为16进制的文本文件: fh = open('EBIKE_73H.BIN', 'rb') str = fh.read() 这个读到str里的到底是什么格式呢?? 在网上查了查好像要用struct.unpack转 搞了半天不得要领 那位指点一下 我想把str里的东西以16进制的形式print出来就可以了,怎么做呢?
2006年09月12日 星期二 21:27
for i in range(0,len(str): print hex(int(str[i])) 2006/9/12, zhangpf <zhangpf在ichaier.com>: > > ÓÐÒ»¸ö¶þ½øÖƵÄbitÎļþ£¬Ïë°ÑËûµÄÄÚÈÝת»¯Îª16½øÖƵÄÎı¾Îļþ£º > > fh = open('EBIKE_73H.BIN', 'rb') > str = fh.read() > Õâ¸ö¶Áµ½strÀïµÄµ½µ×ÊÇʲô¸ñʽÄØ£¿£¿ > > ÔÚÍøÉϲéÁ˲éºÃÏñÒªÓÃstruct.unpackת > ¸ãÁË°ëÌì²»µÃÒªÁì > > ÄÇλָµãһϠ> > ÎÒÏë°ÑstrÀïµÄ¶«Î÷ÒÔ16½øÖƵÄÐÎʽprint³öÀ´¾Í¿ÉÒÔÁË£¬Ôõô×öÄØ£¿ > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20060912/87e9c6df/attachment.htm
2006年09月12日 星期二 22:09
for i in range(0,len(str): print hex(int(str[i],2)) 似乎这样才可以…… -- 云电清华同方小民工
2006年09月12日 星期二 22:16
for c in str: print "%02x" % ord(c) HN On 9/12/06, 笨笨狗 <chen.ruijie在gmail.com> wrote: > for i in range(0,len(str): > print hex(int(str[i],2)) > 似乎这样才可以…… > > > -- > 云电清华同方小民工 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese
2006年09月12日 星期二 22:21
有个模块叫binascii 2006/9/12, H Ni <h.ni.bsd at gmail.com>: > for c in str: > print "%02x" % ord(c) > > > HN > > On 9/12/06, 笨笨狗 <chen.ruijie at gmail.com> wrote: > > for i in range(0,len(str): > > print hex(int(str[i],2)) > > 似乎这样才可以…… > > > > > > -- > > 云电清华同方小民工 > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese
2006年09月12日 星期二 22:38
hoho, 当时看过这个模块, 可是没注意到hexify 那么应该是: hexs = binascii(str) HN On 9/12/06, 3751 <lwm3751在gmail.com> wrote: > 有个模块叫binascii > > 2006/9/12, H Ni <h.ni.bsd在gmail.com>: > > for c in str: > > print "%02x" % ord(c) > > > > > > HN > > > > On 9/12/06, 笨笨狗 <chen.ruijie在gmail.com> wrote: > > > for i in range(0,len(str): > > > print hex(int(str[i],2)) > > > 似乎这样才可以…… > > > > > > > > > -- > > > 云电清华同方小民工 > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese
2006年09月12日 星期二 22:41
对不起, 是hexlify HN On 9/12/06, H Ni <h.ni.bsd在gmail.com> wrote: > hoho, 当时看过这个模块, 可是没注意到hexify > > 那么应该是: > > hexs = binascii(str) > > > HN > > On 9/12/06, 3751 <lwm3751在gmail.com> wrote: > > 有个模块叫binascii > > > > 2006/9/12, H Ni <h.ni.bsd在gmail.com>: > > > for c in str: > > > print "%02x" % ord(c) > > > > > > > > > HN > > > > > > On 9/12/06, 笨笨狗 <chen.ruijie在gmail.com> wrote: > > > > for i in range(0,len(str): > > > > print hex(int(str[i],2)) > > > > 似乎这样才可以…… > > > > > > > > > > > > -- > > > > 云电清华同方小民工 > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese >
2006年09月12日 星期二 22:43
又错了, 今天诸事不宜呀 hexs = binascii.hexlify(str) HN On 9/12/06, H Ni <h.ni.bsd在gmail.com> wrote: > 对不起, 是hexlify > > HN > > On 9/12/06, H Ni <h.ni.bsd在gmail.com> wrote: > > hoho, 当时看过这个模块, 可是没注意到hexify > > > > 那么应该是: > > > > hexs = binascii(str) > > > > > > HN > > > > On 9/12/06, 3751 <lwm3751在gmail.com> wrote: > > > 有个模块叫binascii > > > > > > 2006/9/12, H Ni <h.ni.bsd在gmail.com>: > > > > for c in str: > > > > print "%02x" % ord(c) > > > > > > > > > > > > HN > > > > > > > > On 9/12/06, 笨笨狗 <chen.ruijie在gmail.com> wrote: > > > > > for i in range(0,len(str): > > > > > print hex(int(str[i],2)) > > > > > 似乎这样才可以…… > > > > > > > > > > > > > > > -- > > > > > 云电清华同方小民工 > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > >
Zeuux © 2025
京ICP备05028076号