The Artima Developer Community
Sponsored Link

Python Answers Forum
Log Console output

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Storm To

Posts: 5
Nickname: storm
Registered: Oct, 2005

Log Console output Posted: Oct 27, 2005 1:25 PM
Reply to this message Reply
Advertisement
I created a test tool for QA in Python that sends commands on Serial or USB ports (as well as TCP/IP, XML) and uses the console to display the output
[ SENT ]: xyz
[RECEIVED]: abc
[EXPECTED]: abc
[ RESULT ]: PASS

QA wants this logged to a text file of their choice; so I told them to run the .py file with the > redirect (test.py > log.txt) as a temporary solution.

Is there an easy way of having the console output doubled to a file as well? I looked at the standard Python logging module and I didn't find it usefull.

Perfect solution would be if I can import something in my main run file and create a new instance (thread) with a "path\\filename.txt" variable, and this would hook the console output and send it to a file without me having to change any other files.

THANKS!

Topic: C structures in python Previous Topic   Next Topic Topic: can't find a needed method in ftplib

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use