firemail

标题: python资料查找方法 [打印本页]

作者: Qter    时间: 2020-12-19 20:33
标题: python资料查找方法
https://www.python.org/doc/
Python 3.x Resources
https://docs.python.org/3/tutorial/index.html

11. Brief Tour of the Standard Library — Part II


11.5. Logging
The logging module offers a full featured and flexible logging system. At its simplest, log messages are sent to a file or to sys.stderr:

这个  logging
https://docs.python.org/3/library/logging.html#module-logging

Format
Description

filename
Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler.

filemode
If filename is specified, open the file in this mode. Defaults to 'a'.
点这个 mode
Character
Meaning

'r'
open for reading (default)

'w'
open for writing, truncating the file first

'x'
open for exclusive creation, failing if the file already exists

'a'
open for writing, appending to the end of the file if it exists

'b'
binary mode

't'
text mode (default)

'+'
open for updating (reading and writing)








欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3