Thursday 15 January 2015

python - logging not writing to file when called from function in Pyscripter -


Currently if I run the following code from the Python command line, then it should be filename as expected

  Import logging test (): logging.basicConfig (format = '% (asctime) s% (message)', datefmt = '% m /% d /% Y% I: % M:% S% p ', filename = r'C: \ users \ theo \ documents \ myLog.txt') logging. Warning ('Example log message.') Exam ()   

But when I copy the code into one of my functions and execute the function with a pic scriptor, write this file Does not seem to be. How can I get logging in Pyscripter?

There is an 'external run' option in the password (Run & gt; External Run (Alt + F9) ), The logging function is done.

No comments:

Post a Comment