configparser.ConfigParser.remove_option()

remove_option(section, option) Remove the specified option from the specified section. If the section does not exist, raise NoSectionError. If the option existed to be removed, return True; otherwise return False.

xml.etree.ElementTree.ElementTree.parse()

parse(source, parser=None) Loads an external XML section into this element tree. source is a file name or file object. parser is an optional parser instance. If not given, the standard XMLParser parser is used. Returns the section root element.

contextlib.closing()

contextlib.closing(thing) Return a context manager that closes thing upon completion of the block. This is basically equivalent to: from contextlib import contextmanager @contextmanager def closing(thing): try: yield thing finally: thing.close() And lets you write code like this: from contextlib import closing from urllib.request import urlopen with closing(urlopen('http://www.python.org')) as page: for line in page: print(line) without needing to expl

contextlib.ContextDecorator

class contextlib.ContextDecorator A base class that enables a context manager to also be used as a decorator. Context managers inheriting from ContextDecorator have to implement __enter__ and __exit__ as normal. __exit__ retains its optional exception handling even when used as a decorator. ContextDecorator is used by contextmanager(), so you get this functionality automatically. Example of ContextDecorator: from contextlib import ContextDecorator class mycontext(ContextDecorator): def

tkinter.ttk.Treeview.insert()

insert(parent, index, iid=None, **kw) Creates a new item and returns the item identifier of the newly created item. parent is the item ID of the parent item, or the empty string to create a new top-level item. index is an integer, or the value “end”, specifying where in the list of parent’s children to insert the new item. If index is less than or equal to zero, the new node is inserted at the beginning; if index is greater than or equal to the current number of children, it is inserted at t

datetime.time.__str__()

time.__str__() For a time t, str(t) is equivalent to t.isoformat().

sys.platform

sys.platform This string contains a platform identifier that can be used to append platform-specific components to sys.path, for instance. For Unix systems, except on Linux, this is the lowercased OS name as returned by uname -s with the first part of the version as returned by uname -r appended, e.g. 'sunos5' or 'freebsd8', at the time when Python was built. Unless you want to test for a specific system version, it is therefore recommended to use the following idiom: if sys.platform.startsw

logging.handlers.SysLogHandler.emit()

emit(record) The record is formatted, and then sent to the syslog server. If exception information is present, it is not sent to the server. Changed in version 3.2.1: (See: issue 12168.) In earlier versions, the message sent to the syslog daemons was always terminated with a NUL byte, because early versions of these daemons expected a NUL terminated message - even though it’s not in the relevant specification (RFC 5424). More recent versions of these daemons don’t expect the NUL byte but st

gettext.GNUTranslations.ngettext()

GNUTranslations.ngettext(singular, plural, n) Do a plural-forms lookup of a message id. singular is used as the message id for purposes of lookup in the catalog, while n is used to determine which plural form to use. The returned message string is a Unicode string. If the message id is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback’s ngettext() method. Otherwise, when n is 1 singular is returned, and plural is returned in all other cases. Here

zipfile.ZipFile.writestr()

ZipFile.writestr(zinfo_or_arcname, data[, compress_type]) Write the string data to the archive; zinfo_or_arcname is either the file name it will be given in the archive, or a ZipInfo instance. If it’s an instance, at least the filename, date, and time must be given. If it’s a name, the date and time is set to the current date and time. The archive must be opened with mode 'w', 'x' or 'a' – calling writestr() on a ZipFile created with mode 'r' will raise a RuntimeError. Calling writestr() on