Advertisement
gauravssnl

stderr.py

Sep 28th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. # stderr.py
  2. import sys
  3. file = "C:\\stderrlog.txt"
  4. fsock = open(file,"w")
  5. sys.stderr = fsock
  6. raise Exception ,"This error will be logged"
  7. #this code is not necessary
  8. fsock.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement