回复: Re: Need your help

1011_wxy 1011_wxy at 163.com
Thu Apr 28 14:56:12 CEST 2011


Hi JM:

python c.py > afile.log 


could you pls give me the whole example?
I am so sorry that I am a beginner in Python.


2011-04-28



1011_wxy



发件人: Jean-Michel Pichavant <jeanmichel at sequans.com>
发送时间: 2011-04-28 20:42
主 题: Re: Need your help
收件人: 1011_wxy <1011_wxy at 163.com>
抄 送: "python-list at python.org" <python-list at python.org>





1011_wxy wrote: 
> Hi friends: 
>   
> Here I need some help. 
>   
> #encoding="utf-8" 
> #moudle a.py 
> def a(): 
>     print " function a!" 
>   
> #encoding="utf-8" 
> #moudle b.py 
> def b(): 
>     print " function b!" 
>   
>   
> #encoding="utf-8" 
> #moudle c.py 
> import a 
> import b 
> def c(): 
>     a.a() 
> b.b() 
>   
>   
> Here in function c,How can i record all the information printed by a  
> and b with out modifying moudle a and b? 
> I want to output all the printed information into a text file. 
>   
> Need your help, thanks a lot! 
>   
> Best Regards 
>   
> 2011-04-28 
> ------------------------------------------------------------------------ 
> Kerry Wang 
Hi, 

python c.py > afile.log 


JM 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110428/30dfca5a/attachment.html>


More information about the Python-list mailing list