doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
operator.lshift(a, b) operator.__lshift__(a, b) Return a shifted left by b.
python.library.operator#operator.lshift
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.lt
operator.matmul(a, b) operator.__matmul__(a, b) Return a @ b. New in version 3.5.
python.library.operator#operator.matmul
operator.methodcaller(name, /, *args, **kwargs) Return a callable object that calls the method name on its operand. If additional arguments and/or keyword arguments are given, they will be given to the method as well. For example: After f = methodcaller('name'), the call f(b) returns b.name(). After f = methodcaller...
python.library.operator#operator.methodcaller
operator.mod(a, b) operator.__mod__(a, b) Return a % b.
python.library.operator#operator.mod
operator.mul(a, b) operator.__mul__(a, b) Return a * b, for a and b numbers.
python.library.operator#operator.mul
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.ne
operator.neg(obj) operator.__neg__(obj) Return obj negated (-obj).
python.library.operator#operator.neg
operator.not_(obj) operator.__not__(obj) Return the outcome of not obj. (Note that there is no __not__() method for object instances; only the interpreter core defines this operation. The result is affected by the __bool__() and __len__() methods.)
python.library.operator#operator.not_
operator.or_(a, b) operator.__or__(a, b) Return the bitwise or of a and b.
python.library.operator#operator.or_
operator.pos(obj) operator.__pos__(obj) Return obj positive (+obj).
python.library.operator#operator.pos
operator.pow(a, b) operator.__pow__(a, b) Return a ** b, for a and b numbers.
python.library.operator#operator.pow
operator.rshift(a, b) operator.__rshift__(a, b) Return a shifted right by b.
python.library.operator#operator.rshift
operator.setitem(a, b, c) operator.__setitem__(a, b, c) Set the value of a at index b to c.
python.library.operator#operator.setitem
operator.sub(a, b) operator.__sub__(a, b) Return a - b.
python.library.operator#operator.sub
operator.truediv(a, b) operator.__truediv__(a, b) Return a / b where 2/3 is .66 rather than 0. This is also known as “true” division.
python.library.operator#operator.truediv
operator.truth(obj) Return True if obj is true, and False otherwise. This is equivalent to using the bool constructor.
python.library.operator#operator.truth
operator.xor(a, b) operator.__xor__(a, b) Return the bitwise exclusive or of a and b.
python.library.operator#operator.xor
operator.abs(obj) operator.__abs__(obj) Return the absolute value of obj.
python.library.operator#operator.__abs__
operator.add(a, b) operator.__add__(a, b) Return a + b, for a and b numbers.
python.library.operator#operator.__add__
operator.and_(a, b) operator.__and__(a, b) Return the bitwise and of a and b.
python.library.operator#operator.__and__
operator.concat(a, b) operator.__concat__(a, b) Return a + b for a and b sequences.
python.library.operator#operator.__concat__
operator.contains(a, b) operator.__contains__(a, b) Return the outcome of the test b in a. Note the reversed operands.
python.library.operator#operator.__contains__
operator.delitem(a, b) operator.__delitem__(a, b) Remove the value of a at index b.
python.library.operator#operator.__delitem__
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.__eq__
operator.floordiv(a, b) operator.__floordiv__(a, b) Return a // b.
python.library.operator#operator.__floordiv__
operator.getitem(a, b) operator.__getitem__(a, b) Return the value of a at index b.
python.library.operator#operator.__getitem__
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.__ge__
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.__gt__
operator.iadd(a, b) operator.__iadd__(a, b) a = iadd(a, b) is equivalent to a += b.
python.library.operator#operator.__iadd__
operator.iand(a, b) operator.__iand__(a, b) a = iand(a, b) is equivalent to a &= b.
python.library.operator#operator.__iand__
operator.iconcat(a, b) operator.__iconcat__(a, b) a = iconcat(a, b) is equivalent to a += b for a and b sequences.
python.library.operator#operator.__iconcat__
operator.ifloordiv(a, b) operator.__ifloordiv__(a, b) a = ifloordiv(a, b) is equivalent to a //= b.
python.library.operator#operator.__ifloordiv__
operator.ilshift(a, b) operator.__ilshift__(a, b) a = ilshift(a, b) is equivalent to a <<= b.
python.library.operator#operator.__ilshift__
operator.imatmul(a, b) operator.__imatmul__(a, b) a = imatmul(a, b) is equivalent to a @= b. New in version 3.5.
python.library.operator#operator.__imatmul__
operator.imod(a, b) operator.__imod__(a, b) a = imod(a, b) is equivalent to a %= b.
python.library.operator#operator.__imod__
operator.imul(a, b) operator.__imul__(a, b) a = imul(a, b) is equivalent to a *= b.
python.library.operator#operator.__imul__
operator.index(a) operator.__index__(a) Return a converted to an integer. Equivalent to a.__index__().
python.library.operator#operator.__index__
operator.inv(obj) operator.invert(obj) operator.__inv__(obj) operator.__invert__(obj) Return the bitwise inverse of the number obj. This is equivalent to ~obj.
python.library.operator#operator.__invert__
operator.inv(obj) operator.invert(obj) operator.__inv__(obj) operator.__invert__(obj) Return the bitwise inverse of the number obj. This is equivalent to ~obj.
python.library.operator#operator.__inv__
operator.ior(a, b) operator.__ior__(a, b) a = ior(a, b) is equivalent to a |= b.
python.library.operator#operator.__ior__
operator.ipow(a, b) operator.__ipow__(a, b) a = ipow(a, b) is equivalent to a **= b.
python.library.operator#operator.__ipow__
operator.irshift(a, b) operator.__irshift__(a, b) a = irshift(a, b) is equivalent to a >>= b.
python.library.operator#operator.__irshift__
operator.isub(a, b) operator.__isub__(a, b) a = isub(a, b) is equivalent to a -= b.
python.library.operator#operator.__isub__
operator.itruediv(a, b) operator.__itruediv__(a, b) a = itruediv(a, b) is equivalent to a /= b.
python.library.operator#operator.__itruediv__
operator.ixor(a, b) operator.__ixor__(a, b) a = ixor(a, b) is equivalent to a ^= b.
python.library.operator#operator.__ixor__
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.__le__
operator.lshift(a, b) operator.__lshift__(a, b) Return a shifted left by b.
python.library.operator#operator.__lshift__
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.__lt__
operator.matmul(a, b) operator.__matmul__(a, b) Return a @ b. New in version 3.5.
python.library.operator#operator.__matmul__
operator.mod(a, b) operator.__mod__(a, b) Return a % b.
python.library.operator#operator.__mod__
operator.mul(a, b) operator.__mul__(a, b) Return a * b, for a and b numbers.
python.library.operator#operator.__mul__
operator.neg(obj) operator.__neg__(obj) Return obj negated (-obj).
python.library.operator#operator.__neg__
operator.lt(a, b) operator.le(a, b) operator.eq(a, b) operator.ne(a, b) operator.ge(a, b) operator.gt(a, b) operator.__lt__(a, b) operator.__le__(a, b) operator.__eq__(a, b) operator.__ne__(a, b) operator.__ge__(a, b) operator.__gt__(a, b) Perform “rich comparisons” between a and b. Specifically...
python.library.operator#operator.__ne__
operator.not_(obj) operator.__not__(obj) Return the outcome of not obj. (Note that there is no __not__() method for object instances; only the interpreter core defines this operation. The result is affected by the __bool__() and __len__() methods.)
python.library.operator#operator.__not__
operator.or_(a, b) operator.__or__(a, b) Return the bitwise or of a and b.
python.library.operator#operator.__or__
operator.pos(obj) operator.__pos__(obj) Return obj positive (+obj).
python.library.operator#operator.__pos__
operator.pow(a, b) operator.__pow__(a, b) Return a ** b, for a and b numbers.
python.library.operator#operator.__pow__
operator.rshift(a, b) operator.__rshift__(a, b) Return a shifted right by b.
python.library.operator#operator.__rshift__
operator.setitem(a, b, c) operator.__setitem__(a, b, c) Set the value of a at index b to c.
python.library.operator#operator.__setitem__
operator.sub(a, b) operator.__sub__(a, b) Return a - b.
python.library.operator#operator.__sub__
operator.truediv(a, b) operator.__truediv__(a, b) Return a / b where 2/3 is .66 rather than 0. This is also known as “true” division.
python.library.operator#operator.__truediv__
operator.xor(a, b) operator.__xor__(a, b) Return the bitwise exclusive or of a and b.
python.library.operator#operator.__xor__
ord(c) Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. For example, ord('a') returns the integer 97 and ord('€') (Euro sign) returns 8364. This is the inverse of chr().
python.library.functions#ord
os — Miscellaneous operating system interfaces Source code: Lib/os.py This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, see the os.path module, and if you want to read all the lines in all the file...
python.library.os
os.abort() Generate a SIGABRT signal to the current process. On Unix, the default behavior is to produce a core dump; on Windows, the process immediately returns an exit code of 3. Be aware that calling this function will not call the Python signal handler registered for SIGABRT with signal.signal().
python.library.os#os.abort
os.access(path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True) Use the real uid/gid to test for access to path. Note that most operations will use the effective uid/gid, therefore this routine can be used in a suid/sgid environment to test if the invoking user has the specified access to path. mode ...
python.library.os#os.access
os.add_dll_directory(path) Add a path to the DLL search path. This search path is used when resolving dependencies for imported extension modules (the module itself is resolved through sys.path), and also by ctypes. Remove the directory by calling close() on the returned object or using it in a with statement. See th...
python.library.os#os.add_dll_directory
os.altsep An alternative character used by the operating system to separate pathname components, or None if only one separator character exists. This is set to '/' on Windows systems where sep is a backslash. Also available via os.path.
python.library.os#os.altsep
os.chdir(path) Change the current working directory to path. This function can support specifying a file descriptor. The descriptor must refer to an opened directory, not an open file. This function can raise OSError and subclasses such as FileNotFoundError, PermissionError, and NotADirectoryError. Raises an auditing...
python.library.os#os.chdir
os.chflags(path, flags, *, follow_symlinks=True) Set the flags of path to the numeric flags. flags may take a combination (bitwise OR) of the following values (as defined in the stat module): stat.UF_NODUMP stat.UF_IMMUTABLE stat.UF_APPEND stat.UF_OPAQUE stat.UF_NOUNLINK stat.UF_COMPRESSED stat.UF_HIDDEN stat.SF_ARC...
python.library.os#os.chflags
os.chmod(path, mode, *, dir_fd=None, follow_symlinks=True) Change the mode of path to the numeric mode. mode may take one of the following values (as defined in the stat module) or bitwise ORed combinations of them: stat.S_ISUID stat.S_ISGID stat.S_ENFMT stat.S_ISVTX stat.S_IREAD stat.S_IWRITE stat.S_IEXEC stat.S_IR...
python.library.os#os.chmod
os.chown(path, uid, gid, *, dir_fd=None, follow_symlinks=True) Change the owner and group id of path to the numeric uid and gid. To leave one of the ids unchanged, set it to -1. This function can support specifying a file descriptor, paths relative to directory descriptors and not following symlinks. See shutil.chown...
python.library.os#os.chown
os.chroot(path) Change the root directory of the current process to path. Availability: Unix. Changed in version 3.6: Accepts a path-like object.
python.library.os#os.chroot
os.CLD_EXITED os.CLD_KILLED os.CLD_DUMPED os.CLD_TRAPPED os.CLD_STOPPED os.CLD_CONTINUED These are the possible values for si_code in the result returned by waitid(). Availability: Unix. New in version 3.3. Changed in version 3.9: Added CLD_KILLED and CLD_STOPPED values.
python.library.os#os.CLD_CONTINUED
os.CLD_EXITED os.CLD_KILLED os.CLD_DUMPED os.CLD_TRAPPED os.CLD_STOPPED os.CLD_CONTINUED These are the possible values for si_code in the result returned by waitid(). Availability: Unix. New in version 3.3. Changed in version 3.9: Added CLD_KILLED and CLD_STOPPED values.
python.library.os#os.CLD_DUMPED
os.CLD_EXITED os.CLD_KILLED os.CLD_DUMPED os.CLD_TRAPPED os.CLD_STOPPED os.CLD_CONTINUED These are the possible values for si_code in the result returned by waitid(). Availability: Unix. New in version 3.3. Changed in version 3.9: Added CLD_KILLED and CLD_STOPPED values.
python.library.os#os.CLD_EXITED
os.CLD_EXITED os.CLD_KILLED os.CLD_DUMPED os.CLD_TRAPPED os.CLD_STOPPED os.CLD_CONTINUED These are the possible values for si_code in the result returned by waitid(). Availability: Unix. New in version 3.3. Changed in version 3.9: Added CLD_KILLED and CLD_STOPPED values.
python.library.os#os.CLD_KILLED
os.CLD_EXITED os.CLD_KILLED os.CLD_DUMPED os.CLD_TRAPPED os.CLD_STOPPED os.CLD_CONTINUED These are the possible values for si_code in the result returned by waitid(). Availability: Unix. New in version 3.3. Changed in version 3.9: Added CLD_KILLED and CLD_STOPPED values.
python.library.os#os.CLD_STOPPED
os.CLD_EXITED os.CLD_KILLED os.CLD_DUMPED os.CLD_TRAPPED os.CLD_STOPPED os.CLD_CONTINUED These are the possible values for si_code in the result returned by waitid(). Availability: Unix. New in version 3.3. Changed in version 3.9: Added CLD_KILLED and CLD_STOPPED values.
python.library.os#os.CLD_TRAPPED
os.close(fd) Close file descriptor fd. Note This function is intended for low-level I/O and must be applied to a file descriptor as returned by os.open() or pipe(). To close a “file object” returned by the built-in function open() or by popen() or fdopen(), use its close() method.
python.library.os#os.close
os.closerange(fd_low, fd_high) Close all file descriptors from fd_low (inclusive) to fd_high (exclusive), ignoring errors. Equivalent to (but much faster than): for fd in range(fd_low, fd_high): try: os.close(fd) except OSError: pass
python.library.os#os.closerange
os.confstr(name) Return string-valued system configuration values. name specifies the configuration value to retrieve; it may be a string which is the name of a defined system value; these names are specified in a number of standards (POSIX, Unix 95, Unix 98, and others). Some platforms define additional names as wel...
python.library.os#os.confstr
os.confstr_names Dictionary mapping names accepted by confstr() to the integer values defined for those names by the host operating system. This can be used to determine the set of names known to the system. Availability: Unix.
python.library.os#os.confstr_names
os.copy_file_range(src, dst, count, offset_src=None, offset_dst=None) Copy count bytes from file descriptor src, starting from offset offset_src, to file descriptor dst, starting from offset offset_dst. If offset_src is None, then src is read from the current position; respectively for offset_dst. The files pointed b...
python.library.os#os.copy_file_range
os.cpu_count() Return the number of CPUs in the system. Returns None if undetermined. This number is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with len(os.sched_getaffinity(0)) New in version 3.4.
python.library.os#os.cpu_count
os.ctermid() Return the filename corresponding to the controlling terminal of the process. Availability: Unix.
python.library.os#os.ctermid
os.curdir The constant string used by the operating system to refer to the current directory. This is '.' for Windows and POSIX. Also available via os.path.
python.library.os#os.curdir
os.defpath The default search path used by exec*p* and spawn*p* if the environment doesn’t have a 'PATH' key. Also available via os.path.
python.library.os#os.defpath
os.device_encoding(fd) Return a string describing the encoding of the device associated with fd if it is connected to a terminal; else return None.
python.library.os#os.device_encoding
os.devnull The file path of the null device. For example: '/dev/null' for POSIX, 'nul' for Windows. Also available via os.path.
python.library.os#os.devnull
class os.DirEntry Object yielded by scandir() to expose the file path and other file attributes of a directory entry. scandir() will provide as much of this information as possible without making additional system calls. When a stat() or lstat() system call is made, the os.DirEntry object will cache the result. os.Di...
python.library.os#os.DirEntry
inode() Return the inode number of the entry. The result is cached on the os.DirEntry object. Use os.stat(entry.path, follow_symlinks=False).st_ino to fetch up-to-date information. On the first, uncached call, a system call is required on Windows but not on Unix.
python.library.os#os.DirEntry.inode
is_dir(*, follow_symlinks=True) Return True if this entry is a directory or a symbolic link pointing to a directory; return False if the entry is or points to any other kind of file, or if it doesn’t exist anymore. If follow_symlinks is False, return True only if this entry is a directory (without following symlinks)...
python.library.os#os.DirEntry.is_dir
is_file(*, follow_symlinks=True) Return True if this entry is a file or a symbolic link pointing to a file; return False if the entry is or points to a directory or other non-file entry, or if it doesn’t exist anymore. If follow_symlinks is False, return True only if this entry is a file (without following symlinks);...
python.library.os#os.DirEntry.is_file
is_symlink() Return True if this entry is a symbolic link (even if broken); return False if the entry points to a directory or any kind of file, or if it doesn’t exist anymore. The result is cached on the os.DirEntry object. Call os.path.islink() to fetch up-to-date information. On the first, uncached call, no system...
python.library.os#os.DirEntry.is_symlink
name The entry’s base filename, relative to the scandir() path argument. The name attribute will be bytes if the scandir() path argument is of type bytes and str otherwise. Use fsdecode() to decode byte filenames.
python.library.os#os.DirEntry.name
path The entry’s full path name: equivalent to os.path.join(scandir_path, entry.name) where scandir_path is the scandir() path argument. The path is only absolute if the scandir() path argument was absolute. If the scandir() path argument was a file descriptor, the path attribute is the same as the name attribute. Th...
python.library.os#os.DirEntry.path
stat(*, follow_symlinks=True) Return a stat_result object for this entry. This method follows symbolic links by default; to stat a symbolic link add the follow_symlinks=False argument. On Unix, this method always requires a system call. On Windows, it only requires a system call if follow_symlinks is True and the ent...
python.library.os#os.DirEntry.stat
os.dup(fd) Return a duplicate of file descriptor fd. The new file descriptor is non-inheritable. On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: stderr), the new file descriptor is inheritable. Changed in version 3.4: The new file descriptor is now non-inheritable.
python.library.os#os.dup