Python论坛  - 讨论区

标题:[python-chinese] 如何将控制台实时显示的数据输出到文件中

2008年02月17日 星期日 23:45

jin xing kinnsei在gmail.com
星期日 二月 17 23:45:55 HKT 2008

PYTHON GSM
ÎÒÏÖÔÚÓÐһ̨GSM ´®¿Ú裬Î÷ÃÅ×ÓµÄTC35£¬ÏÖÔÚÒªÓÃpythonÊÕÈ¡²¦µ½Õâ¸öèÉϵÄÖ÷½ÐºÅ£¬
Ò²¾ÍÊÇ'callerid',ÏìÒ»¸ö¾Í¹Òµç»°£¬Ö»ÒªÊÕ¼¯Ö÷½ÐºÅ£¬¹Ò¶Ï£¬
°ÑÖ÷½ÐºÅÌá½»µ½Ò»¸öPHPµÄWEBÍøÕ¾
http://XXX.XXX.XX.XX/ani_callback.php?callerid=13506200982
È»ºóÖظ´µÃµ½Ö÷½Ð£¬·¢Ë͵½Íø¹Ø£¬ÄÄλÐֵܿÉÒÔ°ïÏÂæѽ

ÔÚ07-8-14£¬yuting cui <yutingcui在gmail.com> дµÀ£º
>
> os.system("ping www.baidu.com > ping.log")
>
> ÔÚ 07-8-13£¬Íõ¶«<minisnakedongdong在gmail.com> дµÀ£º
> > ÎÒʹÓÃÁËos.system("ping www.baidu.com")Ö»ÄÜ·µ»Ø0»òÒ»¸ö¸ºµÄÊýÖµ°¡! ûÄÜʵÏÖ£¬»¹ÊÇллÄ㣬ÎÒÊdzõѧ¡£
> >
> > 2007/8/13, E. T <iwinux在gmail.com >:
> > >
> > > ÔÚ07-8-13£¬Íõ¶« < minisnakedongdong在gmail.com> дµÀ£º
> > >
> > > >
> >
> ÔÚwinÖÐÓÐÒ»¿ØÖÆ̨³ÌÐò£¨1-wire³ÌÐò£©£¬Í¨¹ý´®¿Úʵʱ²É¼¯Êý¾Ý£¨°´Ctrl+CÖÕÖ¹³ÌÐò£©£¬ÐèÒª°ÑÊý¾Ýдµ½Ò»¸öTXTÎļþÖлò¶ÔÊý¾Ý·ÖÎö´¦Àí£¬ÈçºÎÓÃPYTHON±àд£¬ÇëÖ¸µã¡£
> > > >
> > >
> > >  import sys
> > >  origin = sys.stdout
> > >  f = open('file.txt', 'w')
> > >  sys.stdout = f
> > >
> > > ´¦ÀíÍêÖ®ºó,
> > > sys.stdout = origin
> > > f.close()
> > >
> > >
> > > --
> > > Who knows, what could happen
> > > Do what you do, Just keep on laughing
> > > One thing's true
> > > There's always a brand new day.
> > > _______________________________________________
> > > 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




-- 
QQ£º104609351
MSN£ºkinnsei1在hotmail.com
skype:kinnsei98
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080217/2b923df4/attachment.htm 

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

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

    你的回复:

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

    Zeuux © 2024

    京ICP备05028076号