code.InteractiveInterpreter.showsyntaxerror()

InteractiveInterpreter.showsyntaxerror(filename=None) Display the syntax error that just occurred. This does not display a stack trace because there isn’t one for syntax errors. If filename is given, it is stuffed into the exception instead of the default filename provided by Python’s parser, because it always uses '<string>' when reading from a string. The output is written by the write() method.

gc.collect()

gc.collect(generations=2) With no arguments, run a full collection. The optional argument generation may be an integer specifying which generation to collect (from 0 to 2). A ValueError is raised if the generation number is invalid. The number of unreachable objects found is returned. The free lists maintained for a number of built-in types are cleared whenever a full collection or collection of the highest generation (2) is run. Not all items in some free lists may be freed due to the parti

turtle.update()

turtle.update() Perform a TurtleScreen update. To be used when tracer is turned off.

pathlib.Path

class pathlib.Path(*pathsegments) A subclass of PurePath, this class represents concrete paths of the system’s path flavour (instantiating it creates either a PosixPath or a WindowsPath): >>> Path('setup.py') PosixPath('setup.py') pathsegments is specified similarly to PurePath.

turtle.textinput()

turtle.textinput(title, prompt) Parameters: title – string prompt – string Pop up a dialog window for input of a string. Parameter title is the title of the dialog window, propmt is a text mostly describing what information to input. Return the string input. If the dialog is canceled, return None. >>> screen.textinput("NIM", "Name of first player:")

code.InteractiveInterpreter.showtraceback()

InteractiveInterpreter.showtraceback() Display the exception that just occurred. We remove the first stack item because it is within the interpreter object implementation. The output is written by the write() method. Changed in version 3.5: The full chained traceback is displayed instead of just the primary traceback.

mailbox.Message

class mailbox.Message(message=None) A subclass of the email.message module’s Message. Subclasses of mailbox.Message add mailbox-format-specific state and behavior. If message is omitted, the new instance is created in a default, empty state. If message is an email.message.Message instance, its contents are copied; furthermore, any format-specific information is converted insofar as possible if message is a Message instance. If message is a string, a byte string, or a file, it should contain

xml.dom.Element.removeAttributeNS()

Element.removeAttributeNS(namespaceURI, localName) Remove an attribute by name. Note that it uses a localName, not a qname. No exception is raised if there is no matching attribute.

pdb.run()

pdb.run(statement, globals=None, locals=None) Execute the statement (given as a string or a code object) under debugger control. The debugger prompt appears before any code is executed; you can set breakpoints and type continue, or you can step through the statement using step or next (all these commands are explained below). The optional globals and locals arguments specify the environment in which the code is executed; by default the dictionary of the module __main__ is used. (See the expl

tokenize.detect_encoding()

tokenize.detect_encoding(readline) The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (not decoded from bytes) it has read in. It detects the encoding from the presence of a UTF-8 BOM or an encoding cookie as specified in PEP 263. If both a BO