doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
plistlib.loads(data, *, fmt=None, dict_type=dict)
Load a plist from a bytes object. See load() for an explanation of the keyword arguments. New in version 3.4. | python.library.plistlib#plistlib.loads |
class plistlib.UID(data)
Wraps an int. This is used when reading or writing NSKeyedArchiver encoded data, which contains UID (see PList manual). It has one attribute, data, which can be used to retrieve the int value of the UID. data must be in the range 0 <= data < 2**64. New in version 3.8. | python.library.plistlib#plistlib.UID |
Policies An event loop policy is a global per-process object that controls the management of the event loop. Each event loop has a default policy, which can be changed and customized using the policy API. A policy defines the notion of context and manages a separate event loop per context. The default policy defines co... | python.library.asyncio-policy |
poplib — POP3 protocol client Source code: Lib/poplib.py This module defines a class, POP3, which encapsulates a connection to a POP3 server and implements the protocol as defined in RFC 1939. The POP3 class supports both the minimal and optional command sets from RFC 1939. The POP3 class also supports the STLS command... | python.library.poplib |
exception poplib.error_proto
Exception raised on any errors from this module (errors from socket module are not caught). The reason for the exception is passed to the constructor as a string. | python.library.poplib#poplib.error_proto |
class poplib.POP3(host, port=POP3_PORT[, timeout])
This class implements the actual POP3 protocol. The connection is created when the instance is initialized. If port is omitted, the standard POP3 port (110) is used. The optional timeout parameter specifies a timeout in seconds for the connection attempt (if not spec... | python.library.poplib#poplib.POP3 |
POP3.apop(user, secret)
Use the more secure APOP authentication to log into the POP3 server. | python.library.poplib#poplib.POP3.apop |
POP3.capa()
Query the server’s capabilities as specified in RFC 2449. Returns a dictionary in the form {'name': ['param'...]}. New in version 3.4. | python.library.poplib#poplib.POP3.capa |
POP3.dele(which)
Flag message number which for deletion. On most servers deletions are not actually performed until QUIT (the major exception is Eudora QPOP, which deliberately violates the RFCs by doing pending deletes on any disconnect). | python.library.poplib#poplib.POP3.dele |
POP3.getwelcome()
Returns the greeting string sent by the POP3 server. | python.library.poplib#poplib.POP3.getwelcome |
POP3.list([which])
Request message list, result is in the form (response, ['mesg_num octets',
...], octets). If which is set, it is the message to list. | python.library.poplib#poplib.POP3.list |
POP3.noop()
Do nothing. Might be used as a keep-alive. | python.library.poplib#poplib.POP3.noop |
POP3.pass_(password)
Send password, response includes message count and mailbox size. Note: the mailbox on the server is locked until quit() is called. | python.library.poplib#poplib.POP3.pass_ |
POP3.quit()
Signoff: commit changes, unlock mailbox, drop connection. | python.library.poplib#poplib.POP3.quit |
POP3.retr(which)
Retrieve whole message number which, and set its seen flag. Result is in form (response, ['line', ...], octets). | python.library.poplib#poplib.POP3.retr |
POP3.rpop(user)
Use RPOP authentication (similar to UNIX r-commands) to log into POP3 server. | python.library.poplib#poplib.POP3.rpop |
POP3.rset()
Remove any deletion marks for the mailbox. | python.library.poplib#poplib.POP3.rset |
POP3.set_debuglevel(level)
Set the instance’s debugging level. This controls the amount of debugging output printed. The default, 0, produces no debugging output. A value of 1 produces a moderate amount of debugging output, generally a single line per request. A value of 2 or higher produces the maximum amount of deb... | python.library.poplib#poplib.POP3.set_debuglevel |
POP3.stat()
Get mailbox status. The result is a tuple of 2 integers: (message count,
mailbox size). | python.library.poplib#poplib.POP3.stat |
POP3.stls(context=None)
Start a TLS session on the active connection as specified in RFC 2595. This is only allowed before user authentication context parameter is a ssl.SSLContext object which allows bundling SSL configuration options, certificates and private keys into a single (potentially long-lived) structure. P... | python.library.poplib#poplib.POP3.stls |
POP3.top(which, howmuch)
Retrieves the message header plus howmuch lines of the message after the header of message number which. Result is in form (response, ['line', ...],
octets). The POP3 TOP command this method uses, unlike the RETR command, doesn’t set the message’s seen flag; unfortunately, TOP is poorly speci... | python.library.poplib#poplib.POP3.top |
POP3.uidl(which=None)
Return message digest (unique id) list. If which is specified, result contains the unique id for that message in the form 'response mesgnum uid, otherwise result is list (response, ['mesgnum uid', ...], octets). | python.library.poplib#poplib.POP3.uidl |
POP3.user(username)
Send user command, response should indicate that a password is required. | python.library.poplib#poplib.POP3.user |
POP3.utf8()
Try to switch to UTF-8 mode. Returns the server response if successful, raises error_proto if not. Specified in RFC 6856. New in version 3.5. | python.library.poplib#poplib.POP3.utf8 |
class poplib.POP3_SSL(host, port=POP3_SSL_PORT, keyfile=None, certfile=None, timeout=None, context=None)
This is a subclass of POP3 that connects to the server over an SSL encrypted socket. If port is not specified, 995, the standard POP3-over-SSL port is used. timeout works as in the POP3 constructor. context is an ... | python.library.poplib#poplib.POP3_SSL |
posix — The most common POSIX system calls This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface). Do not import this module directly. Instead, import the module os, which provides a portable version of this interfa... | python.library.posix |
posix.environ
A dictionary representing the string environment at the time the interpreter was started. Keys and values are bytes on Unix and str on Windows. For example, environ[b'HOME'] (environ['HOME'] on Windows) is the pathname of your home directory, equivalent to getenv("HOME") in C. Modifying this dictionary ... | python.library.posix#posix.environ |
pow(base, exp[, mod])
Return base to the power exp; if mod is present, return base to the power exp, modulo mod (computed more efficiently than pow(base, exp) % mod). The two-argument form pow(base, exp) is equivalent to using the power operator: base**exp. The arguments must have numeric types. With mixed operand ty... | python.library.functions#pow |
pprint — Data pretty printer Source code: Lib/pprint.py The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the interpreter. If the formatted structures include objects which are not fundamental Python types, the representation may not be lo... | python.library.pprint |
pprint.isreadable(object)
Determine if the formatted representation of object is “readable”, or can be used to reconstruct the value using eval(). This always returns False for recursive objects. >>> pprint.isreadable(stuff)
False | python.library.pprint#pprint.isreadable |
pprint.isrecursive(object)
Determine if object requires a recursive representation. | python.library.pprint#pprint.isrecursive |
pprint.pformat(object, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True)
Return the formatted representation of object as a string. indent, width, depth, compact and sort_dicts will be passed to the PrettyPrinter constructor as formatting parameters. Changed in version 3.4: Added the compact paramet... | python.library.pprint#pprint.pformat |
pprint.pp(object, *args, sort_dicts=False, **kwargs)
Prints the formatted representation of object followed by a newline. If sort_dicts is false (the default), dictionaries will be displayed with their keys in insertion order, otherwise the dict keys will be sorted. args and kwargs will be passed to pprint() as forma... | python.library.pprint#pprint.pp |
pprint.pprint(object, stream=None, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True)
Prints the formatted representation of object on stream, followed by a newline. If stream is None, sys.stdout is used. This may be used in the interactive interpreter instead of the print() function for inspecting va... | python.library.pprint#pprint.pprint |
class pprint.PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, compact=False, sort_dicts=True)
Construct a PrettyPrinter instance. This constructor understands several keyword parameters. An output stream may be set using the stream keyword; the only method used on the stream object is the file protocol’s... | python.library.pprint#pprint.PrettyPrinter |
PrettyPrinter.format(object, context, maxlevels, level)
Returns three values: the formatted version of object as a string, a flag indicating whether the result is readable, and a flag indicating whether recursion was detected. The first argument is the object to be presented. The second is a dictionary which contains... | python.library.pprint#pprint.PrettyPrinter.format |
PrettyPrinter.isreadable(object)
Determine if the formatted representation of the object is “readable,” or can be used to reconstruct the value using eval(). Note that this returns False for recursive objects. If the depth parameter of the PrettyPrinter is set and the object is deeper than allowed, this returns False... | python.library.pprint#pprint.PrettyPrinter.isreadable |
PrettyPrinter.isrecursive(object)
Determine if the object requires a recursive representation. | python.library.pprint#pprint.PrettyPrinter.isrecursive |
PrettyPrinter.pformat(object)
Return the formatted representation of object. This takes into account the options passed to the PrettyPrinter constructor. | python.library.pprint#pprint.PrettyPrinter.pformat |
PrettyPrinter.pprint(object)
Print the formatted representation of object on the configured stream, followed by a newline. | python.library.pprint#pprint.PrettyPrinter.pprint |
pprint.saferepr(object)
Return a string representation of object, protected against recursive data structures. If the representation of object exposes a recursive entry, the recursive reference will be represented as <Recursion on typename with
id=number>. The representation is not otherwise formatted. >>> pprint.saf... | python.library.pprint#pprint.saferepr |
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
Print objects to the text stream file, separated by sep and followed by end. sep, end, file and flush, if present, must be given as keyword arguments. All non-keyword arguments are converted to strings like str() does and written to the stream, separate... | python.library.functions#print |
exception ProcessLookupError
Raised when a given process doesn’t exist. Corresponds to errno ESRCH. | python.library.exceptions#ProcessLookupError |
class profile.Profile(timer=None, timeunit=0.0, subcalls=True, builtins=True)
This class is normally only used if more precise control over profiling is needed than what the cProfile.run() function provides. A custom timer can be supplied for measuring how long code takes to run via the timer argument. This must be a... | python.library.profile#profile.Profile |
create_stats()
Stop collecting profiling data and record the results internally as the current profile. | python.library.profile#profile.Profile.create_stats |
disable()
Stop collecting profiling data. Only in cProfile. | python.library.profile#profile.Profile.disable |
dump_stats(filename)
Write the results of the current profile to filename. | python.library.profile#profile.Profile.dump_stats |
enable()
Start collecting profiling data. Only in cProfile. | python.library.profile#profile.Profile.enable |
print_stats(sort=-1)
Create a Stats object based on the current profile and print the results to stdout. | python.library.profile#profile.Profile.print_stats |
run(cmd)
Profile the cmd via exec(). | python.library.profile#profile.Profile.run |
runcall(func, /, *args, **kwargs)
Profile func(*args, **kwargs) | python.library.profile#profile.Profile.runcall |
runctx(cmd, globals, locals)
Profile the cmd via exec() with the specified global and local environment. | python.library.profile#profile.Profile.runctx |
profile.run(command, filename=None, sort=-1)
This function takes a single argument that can be passed to the exec() function, and an optional file name. In all cases this routine executes: exec(command, __main__.__dict__, __main__.__dict__)
and gathers profiling statistics from the execution. If no file name is pres... | python.library.profile#profile.run |
profile.runctx(command, globals, locals, filename=None, sort=-1)
This function is similar to run(), with added arguments to supply the globals and locals dictionaries for the command string. This routine executes: exec(command, globals, locals)
and gathers profiling statistics as in the run() function above. | python.library.profile#profile.runctx |
class property(fget=None, fset=None, fdel=None, doc=None)
Return a property attribute. fget is a function for getting an attribute value. fset is a function for setting an attribute value. fdel is a function for deleting an attribute value. And doc creates a docstring for the attribute. A typical use is to define a m... | python.library.functions#property |
class pstats.Stats(*filenames or profile, stream=sys.stdout)
This class constructor creates an instance of a “statistics object” from a filename (or list of filenames) or from a Profile instance. Output will be printed to the stream specified by stream. The file selected by the above constructor must have been create... | python.library.profile#pstats.Stats |
add(*filenames)
This method of the Stats class accumulates additional profiling information into the current profiling object. Its arguments should refer to filenames created by the corresponding version of profile.run() or cProfile.run(). Statistics for identically named (re: file, line, name) functions are automati... | python.library.profile#pstats.Stats.add |
dump_stats(filename)
Save the data loaded into the Stats object to a file named filename. The file is created if it does not exist, and is overwritten if it already exists. This is equivalent to the method of the same name on the profile.Profile and cProfile.Profile classes. | python.library.profile#pstats.Stats.dump_stats |
get_stats_profile()
This method returns an instance of StatsProfile, which contains a mapping of function names to instances of FunctionProfile. Each FunctionProfile instance holds information related to the function’s profile such as how long the function took to run, how many times it was called, etc… New in versi... | python.library.profile#pstats.Stats.get_stats_profile |
print_callees(*restrictions)
This method for the Stats class prints a list of all function that were called by the indicated function. Aside from this reversal of direction of calls (re: called vs was called by), the arguments and ordering are identical to the print_callers() method. | python.library.profile#pstats.Stats.print_callees |
print_callers(*restrictions)
This method for the Stats class prints a list of all functions that called each function in the profiled database. The ordering is identical to that provided by print_stats(), and the definition of the restricting argument is also identical. Each caller is reported on its own line. The fo... | python.library.profile#pstats.Stats.print_callers |
print_stats(*restrictions)
This method for the Stats class prints out a report as described in the profile.run() definition. The order of the printing is based on the last sort_stats() operation done on the object (subject to caveats in add() and strip_dirs()). The arguments provided (if any) can be used to limit the... | python.library.profile#pstats.Stats.print_stats |
reverse_order()
This method for the Stats class reverses the ordering of the basic list within the object. Note that by default ascending vs descending order is properly selected based on the sort key of choice. | python.library.profile#pstats.Stats.reverse_order |
sort_stats(*keys)
This method modifies the Stats object by sorting it according to the supplied criteria. The argument can be either a string or a SortKey enum identifying the basis of a sort (example: 'time', 'name', SortKey.TIME or SortKey.NAME). The SortKey enums argument have advantage over the string argument in... | python.library.profile#pstats.Stats.sort_stats |
strip_dirs()
This method for the Stats class removes all leading path information from file names. It is very useful in reducing the size of the printout to fit within (close to) 80 columns. This method modifies the object, and the stripped information is lost. After performing a strip operation, the object is consid... | python.library.profile#pstats.Stats.strip_dirs |
pty — Pseudo-terminal utilities Source code: Lib/pty.py The pty module defines operations for handling the pseudo-terminal concept: starting another process and being able to write to and read from its controlling terminal programmatically. Because pseudo-terminal handling is highly platform dependent, there is code to... | python.library.pty |
pty.fork()
Fork. Connect the child’s controlling terminal to a pseudo-terminal. Return value is (pid, fd). Note that the child gets pid 0, and the fd is invalid. The parent’s return value is the pid of the child, and fd is a file descriptor connected to the child’s controlling terminal (and also to the child’s standa... | python.library.pty#pty.fork |
pty.openpty()
Open a new pseudo-terminal pair, using os.openpty() if possible, or emulation code for generic Unix systems. Return a pair of file descriptors (master, slave), for the master and the slave end, respectively. | python.library.pty#pty.openpty |
pty.spawn(argv[, master_read[, stdin_read]])
Spawn a process, and connect its controlling terminal with the current process’s standard io. This is often used to baffle programs which insist on reading from the controlling terminal. It is expected that the process spawned behind the pty will eventually terminate, and ... | python.library.pty#pty.spawn |
pwd — The password database This module provides access to the Unix user account and password database. It is available on all Unix versions. Password database entries are reported as a tuple-like object, whose attributes correspond to the members of the passwd structure (Attribute field below, see <pwd.h>):
Index A... | python.library.pwd |
pwd.getpwall()
Return a list of all available password database entries, in arbitrary order. | python.library.pwd#pwd.getpwall |
pwd.getpwnam(name)
Return the password database entry for the given user name. | python.library.pwd#pwd.getpwnam |
pwd.getpwuid(uid)
Return the password database entry for the given numeric user ID. | python.library.pwd#pwd.getpwuid |
pyclbr — Python module browser support Source code: Lib/pyclbr.py The pyclbr module provides limited information about the functions, classes, and methods defined in a Python-coded module. The information is sufficient to implement a module browser. The information is extracted from the Python source code rather than b... | python.library.pyclbr |
Class.children
A dictionary mapping names to descriptors for nested functions and classes. New in version 3.7. | python.library.pyclbr#pyclbr.Class.children |
Class.file
Name of the file in which the class is defined. | python.library.pyclbr#pyclbr.Class.file |
Class.lineno
The line number in the file where the definition starts. | python.library.pyclbr#pyclbr.Class.lineno |
Class.methods
A dictionary mapping method names to line numbers. This can be derived from the newer children dictionary, but remains for back-compatibility. | python.library.pyclbr#pyclbr.Class.methods |
Class.module
The name of the module defining the class described. | python.library.pyclbr#pyclbr.Class.module |
Class.name
The name of the class. | python.library.pyclbr#pyclbr.Class.name |
Class.parent
For top-level classes, None. For nested classes, the parent. New in version 3.7. | python.library.pyclbr#pyclbr.Class.parent |
Class.super
A list of Class objects which describe the immediate base classes of the class being described. Classes which are named as superclasses but which are not discoverable by readmodule_ex() are listed as a string with the class name instead of as Class objects. | python.library.pyclbr#pyclbr.Class.super |
Function.children
A dictionary mapping names to descriptors for nested functions and classes. New in version 3.7. | python.library.pyclbr#pyclbr.Function.children |
Function.file
Name of the file in which the function is defined. | python.library.pyclbr#pyclbr.Function.file |
Function.lineno
The line number in the file where the definition starts. | python.library.pyclbr#pyclbr.Function.lineno |
Function.module
The name of the module defining the function described. | python.library.pyclbr#pyclbr.Function.module |
Function.name
The name of the function. | python.library.pyclbr#pyclbr.Function.name |
Function.parent
For top-level functions, None. For nested functions, the parent. New in version 3.7. | python.library.pyclbr#pyclbr.Function.parent |
pyclbr.readmodule(module, path=None)
Return a dictionary mapping module-level class names to class descriptors. If possible, descriptors for imported base classes are included. Parameter module is a string with the name of the module to read; it may be the name of a module within a package. If given, path is a sequen... | python.library.pyclbr#pyclbr.readmodule |
pyclbr.readmodule_ex(module, path=None)
Return a dictionary-based tree containing a function or class descriptors for each function and class defined in the module with a def or class statement. The returned dictionary maps module-level function and class names to their descriptors. Nested objects are entered into th... | python.library.pyclbr#pyclbr.readmodule_ex |
pydoc — Documentation generator and online help system Source code: Lib/pydoc.py The pydoc module automatically generates documentation from Python modules. The documentation can be presented as pages of text on the console, served to a Web browser, or saved to HTML files. For modules, classes, functions and methods, t... | python.library.pydoc |
py_compile — Compile Python source files Source code: Lib/py_compile.py The py_compile module provides a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script. Though not often needed, this function can be useful when installing modules fo... | python.library.py_compile |
py_compile.compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, invalidation_mode=PycInvalidationMode.TIMESTAMP, quiet=0)
Compile a source file to byte-code and write out the byte-code cache file. The source code is loaded from the file named file. The byte-code is written to cfile, which defaults to the... | python.library.py_compile#py_compile.compile |
py_compile.main(args=None)
Compile several source files. The files named in args (or on the command line, if args is None) are compiled and the resulting byte-code is cached in the normal manner. This function does not search a directory structure to locate source files; it only compiles files named explicitly. If '-... | python.library.py_compile#py_compile.main |
class py_compile.PycInvalidationMode
A enumeration of possible methods the interpreter can use to determine whether a bytecode file is up to date with a source file. The .pyc file indicates the desired invalidation mode in its header. See Cached bytecode invalidation for more information on how Python invalidates .py... | python.library.py_compile#py_compile.PycInvalidationMode |
CHECKED_HASH
The .pyc file includes a hash of the source file content, which Python will compare against the source at runtime to determine if the .pyc file needs to be regenerated. | python.library.py_compile#py_compile.PycInvalidationMode.CHECKED_HASH |
TIMESTAMP
The .pyc file includes the timestamp and size of the source file, which Python will compare against the metadata of the source file at runtime to determine if the .pyc file needs to be regenerated. | python.library.py_compile#py_compile.PycInvalidationMode.TIMESTAMP |
UNCHECKED_HASH
Like CHECKED_HASH, the .pyc file includes a hash of the source file content. However, Python will at runtime assume the .pyc file is up to date and not validate the .pyc against the source file at all. This option is useful when the .pycs are kept up to date by some system external to Python like a bui... | python.library.py_compile#py_compile.PycInvalidationMode.UNCHECKED_HASH |
exception py_compile.PyCompileError
Exception raised when an error occurs while attempting to compile the file. | python.library.py_compile#py_compile.PyCompileError |
queue — A synchronized queue class Source code: Lib/queue.py The queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics... | python.library.queue |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.