doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
class ctypes.c_ulong
Represents the C unsigned long datatype. The constructor accepts an optional integer initializer; no overflow checking is done. | python.library.ctypes#ctypes.c_ulong |
class ctypes.c_ulonglong
Represents the C unsigned long long datatype. The constructor accepts an optional integer initializer; no overflow checking is done. | python.library.ctypes#ctypes.c_ulonglong |
class ctypes.c_ushort
Represents the C unsigned short datatype. The constructor accepts an optional integer initializer; no overflow checking is done. | python.library.ctypes#ctypes.c_ushort |
class ctypes.c_void_p
Represents the C void * type. The value is represented as integer. The constructor accepts an optional integer initializer. | python.library.ctypes#ctypes.c_void_p |
class ctypes.c_wchar
Represents the C wchar_t datatype, and interprets the value as a single character unicode string. The constructor accepts an optional string initializer, the length of the string must be exactly one character. | python.library.ctypes#ctypes.c_wchar |
class ctypes.c_wchar_p
Represents the C wchar_t * datatype, which must be a pointer to a zero-terminated wide character string. The constructor accepts an integer address, or a string. | python.library.ctypes#ctypes.c_wchar_p |
ctypes.DllCanUnloadNow()
Windows only: This function is a hook which allows implementing in-process COM servers with ctypes. It is called from the DllCanUnloadNow function that the _ctypes extension dll exports. | python.library.ctypes#ctypes.DllCanUnloadNow |
ctypes.DllGetClassObject()
Windows only: This function is a hook which allows implementing in-process COM servers with ctypes. It is called from the DllGetClassObject function that the _ctypes extension dll exports. | python.library.ctypes#ctypes.DllGetClassObject |
ctypes.FormatError([code])
Windows only: Returns a textual description of the error code code. If no error code is specified, the last error code is used by calling the Windows api function GetLastError. | python.library.ctypes#ctypes.FormatError |
ctypes.GetLastError()
Windows only: Returns the last error code set by Windows in the calling thread. This function calls the Windows GetLastError() function directly, it does not return the ctypes-private copy of the error code. | python.library.ctypes#ctypes.GetLastError |
ctypes.get_errno()
Returns the current value of the ctypes-private copy of the system errno variable in the calling thread. Raises an auditing event ctypes.get_errno with no arguments. | python.library.ctypes#ctypes.get_errno |
ctypes.get_last_error()
Windows only: returns the current value of the ctypes-private copy of the system LastError variable in the calling thread. Raises an auditing event ctypes.get_last_error with no arguments. | python.library.ctypes#ctypes.get_last_error |
class ctypes.HRESULT
Windows only: Represents a HRESULT value, which contains success or error information for a function or method call. | python.library.ctypes#ctypes.HRESULT |
class ctypes.LibraryLoader(dlltype)
Class which loads shared libraries. dlltype should be one of the CDLL, PyDLL, WinDLL, or OleDLL types. __getattr__() has special behavior: It allows loading a shared library by accessing it as attribute of a library loader instance. The result is cached, so repeated attribute acces... | python.library.ctypes#ctypes.LibraryLoader |
LoadLibrary(name)
Load a shared library into the process and return it. This method always returns a new instance of the library. | python.library.ctypes#ctypes.LibraryLoader.LoadLibrary |
class ctypes.LittleEndianStructure(*args, **kw)
Abstract base class for structures in little endian byte order. | python.library.ctypes#ctypes.LittleEndianStructure |
ctypes.memmove(dst, src, count)
Same as the standard C memmove library function: copies count bytes from src to dst. dst and src must be integers or ctypes instances that can be converted to pointers. | python.library.ctypes#ctypes.memmove |
ctypes.memset(dst, c, count)
Same as the standard C memset library function: fills the memory block at address dst with count bytes of value c. dst must be an integer specifying an address, or a ctypes instance. | python.library.ctypes#ctypes.memset |
class ctypes.OleDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=0)
Windows only: Instances of this class represent loaded shared libraries, functions in these libraries use the stdcall calling convention, and are assumed to return the windows specific HRESULT code. HRESULT val... | python.library.ctypes#ctypes.OleDLL |
ctypes.POINTER(type)
This factory function creates and returns a new ctypes pointer type. Pointer types are cached and reused internally, so calling this function repeatedly is cheap. type must be a ctypes type. | python.library.ctypes#ctypes.POINTER |
ctypes.pointer(obj)
This function creates a new pointer instance, pointing to obj. The returned object is of the type POINTER(type(obj)). Note: If you just want to pass a pointer to an object to a foreign function call, you should use byref(obj) which is much faster. | python.library.ctypes#ctypes.pointer |
class ctypes.PyDLL(name, mode=DEFAULT_MODE, handle=None)
Instances of this class behave like CDLL instances, except that the Python GIL is not released during the function call, and after the function execution the Python error flag is checked. If the error flag is set, a Python exception is raised. Thus, this is onl... | python.library.ctypes#ctypes.PyDLL |
PyDLL._handle
The system handle used to access the library. | python.library.ctypes#ctypes.PyDLL._handle |
PyDLL._name
The name of the library passed in the constructor. | python.library.ctypes#ctypes.PyDLL._name |
ctypes.PYFUNCTYPE(restype, *argtypes)
The returned function prototype creates functions that use the Python calling convention. The function will not release the GIL during the call. | python.library.ctypes#ctypes.PYFUNCTYPE |
class ctypes.py_object
Represents the C PyObject * datatype. Calling this without an argument creates a NULL PyObject * pointer. | python.library.ctypes#ctypes.py_object |
ctypes.resize(obj, size)
This function resizes the internal memory buffer of obj, which must be an instance of a ctypes type. It is not possible to make the buffer smaller than the native size of the objects type, as given by sizeof(type(obj)), but it is possible to enlarge the buffer. | python.library.ctypes#ctypes.resize |
ctypes.set_errno(value)
Set the current value of the ctypes-private copy of the system errno variable in the calling thread to value and return the previous value. Raises an auditing event ctypes.set_errno with argument errno. | python.library.ctypes#ctypes.set_errno |
ctypes.set_last_error(value)
Windows only: set the current value of the ctypes-private copy of the system LastError variable in the calling thread to value and return the previous value. Raises an auditing event ctypes.set_last_error with argument error. | python.library.ctypes#ctypes.set_last_error |
ctypes.sizeof(obj_or_type)
Returns the size in bytes of a ctypes type or instance memory buffer. Does the same as the C sizeof operator. | python.library.ctypes#ctypes.sizeof |
ctypes.string_at(address, size=-1)
This function returns the C string starting at memory address address as a bytes object. If size is specified, it is used as size, otherwise the string is assumed to be zero-terminated. Raises an auditing event ctypes.string_at with arguments address, size. | python.library.ctypes#ctypes.string_at |
class ctypes.Structure(*args, **kw)
Abstract base class for structures in native byte order. Concrete structure and union types must be created by subclassing one of these types, and at least define a _fields_ class variable. ctypes will create descriptors which allow reading and writing the fields by direct attribut... | python.library.ctypes#ctypes.Structure |
_anonymous_
An optional sequence that lists the names of unnamed (anonymous) fields. _anonymous_ must be already defined when _fields_ is assigned, otherwise it will have no effect. The fields listed in this variable must be structure or union type fields. ctypes will create descriptors in the structure type that all... | python.library.ctypes#ctypes.Structure._anonymous_ |
_fields_
A sequence defining the structure fields. The items must be 2-tuples or 3-tuples. The first item is the name of the field, the second item specifies the type of the field; it can be any ctypes data type. For integer type fields like c_int, a third optional item can be given. It must be a small positive integ... | python.library.ctypes#ctypes.Structure._fields_ |
_pack_
An optional small integer that allows overriding the alignment of structure fields in the instance. _pack_ must already be defined when _fields_ is assigned, otherwise it will have no effect. | python.library.ctypes#ctypes.Structure._pack_ |
class ctypes.Union(*args, **kw)
Abstract base class for unions in native byte order. | python.library.ctypes#ctypes.Union |
ctypes.util.find_library(name)
Try to find a library and return a pathname. name is the library name without any prefix like lib, suffix like .so, .dylib or version number (this is the form used for the posix linker option -l). If no library can be found, returns None. The exact functionality is system dependent. | python.library.ctypes#ctypes.util.find_library |
ctypes.util.find_msvcrt()
Windows only: return the filename of the VC runtime library used by Python, and by the extension modules. If the name of the library cannot be determined, None is returned. If you need to free memory, for example, allocated by an extension module with a call to the free(void *), it is import... | python.library.ctypes#ctypes.util.find_msvcrt |
class ctypes.WinDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=0)
Windows only: Instances of this class represent loaded shared libraries, functions in these libraries use the stdcall calling convention, and are assumed to return int by default. On Windows CE only the standar... | python.library.ctypes#ctypes.WinDLL |
ctypes.WinError(code=None, descr=None)
Windows only: this function is probably the worst-named thing in ctypes. It creates an instance of OSError. If code is not specified, GetLastError is called to determine the error code. If descr is not specified, FormatError() is called to get a textual description of the error.... | python.library.ctypes#ctypes.WinError |
ctypes.WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
Windows only: The returned function prototype creates functions that use the stdcall calling convention, except on Windows CE where WINFUNCTYPE() is the same as CFUNCTYPE(). The function will release the GIL during the call. use_errno and u... | python.library.ctypes#ctypes.WINFUNCTYPE |
ctypes.wstring_at(address, size=-1)
This function returns the wide character string starting at memory address address as a string. If size is specified, it is used as the number of characters of the string, otherwise the string is assumed to be zero-terminated. Raises an auditing event ctypes.wstring_at with argumen... | python.library.ctypes#ctypes.wstring_at |
class ctypes._CData
This non-public class is the common base class of all ctypes data types. Among other things, all ctypes type instances contain a memory block that hold C compatible data; the address of the memory block is returned by the addressof() helper function. Another instance variable is exposed as _object... | python.library.ctypes#ctypes._CData |
from_address(address)
This method returns a ctypes type instance using the memory specified by address which must be an integer.
This method, and others that indirectly call this method, raises an auditing event ctypes.cdata with argument address. | python.library.ctypes#ctypes._CData.from_address |
from_buffer(source[, offset])
This method returns a ctypes instance that shares the buffer of the source object. The source object must support the writeable buffer interface. The optional offset parameter specifies an offset into the source buffer in bytes; the default is zero. If the source buffer is not large enou... | python.library.ctypes#ctypes._CData.from_buffer |
from_buffer_copy(source[, offset])
This method creates a ctypes instance, copying the buffer from the source object buffer which must be readable. The optional offset parameter specifies an offset into the source buffer in bytes; the default is zero. If the source buffer is not large enough a ValueError is raised. Ra... | python.library.ctypes#ctypes._CData.from_buffer_copy |
from_param(obj)
This method adapts obj to a ctypes type. It is called with the actual object used in a foreign function call when the type is present in the foreign function’s argtypes tuple; it must return an object that can be used as a function call parameter. All ctypes data types have a default implementation of... | python.library.ctypes#ctypes._CData.from_param |
in_dll(library, name)
This method returns a ctypes type instance exported by a shared library. name is the name of the symbol that exports the data, library is the loaded shared library. | python.library.ctypes#ctypes._CData.in_dll |
_b_base_
Sometimes ctypes data instances do not own the memory block they contain, instead they share part of the memory block of a base object. The _b_base_ read-only member is the root ctypes object that owns the memory block. | python.library.ctypes#ctypes._CData._b_base_ |
_b_needsfree_
This read-only variable is true when the ctypes data instance has allocated the memory block itself, false otherwise. | python.library.ctypes#ctypes._CData._b_needsfree_ |
_objects
This member is either None or a dictionary containing Python objects that need to be kept alive so that the memory block contents is kept valid. This object is only exposed for debugging; never modify the contents of this dictionary. | python.library.ctypes#ctypes._CData._objects |
class ctypes._FuncPtr
Base class for C callable foreign functions. Instances of foreign functions are also C compatible data types; they represent C function pointers. This behavior can be customized by assigning to special attributes of the foreign function object.
restype
Assign a ctypes type to specify the res... | python.library.ctypes#ctypes._FuncPtr |
argtypes
Assign a tuple of ctypes types to specify the argument types that the function accepts. Functions using the stdcall calling convention can only be called with the same number of arguments as the length of this tuple; functions using the C calling convention accept additional, unspecified arguments as well. W... | python.library.ctypes#ctypes._FuncPtr.argtypes |
errcheck
Assign a Python function or another callable to this attribute. The callable will be called with three or more arguments:
callable(result, func, arguments)
result is what the foreign function returns, as specified by the restype attribute. func is the foreign function object itself, this allows reusing t... | python.library.ctypes#ctypes._FuncPtr.errcheck |
restype
Assign a ctypes type to specify the result type of the foreign function. Use None for void, a function not returning anything. It is possible to assign a callable Python object that is not a ctypes type, in this case the function is assumed to return a C int, and the callable will be called with this integer,... | python.library.ctypes#ctypes._FuncPtr.restype |
class ctypes._Pointer
Private, abstract base class for pointers. Concrete pointer types are created by calling POINTER() with the type that will be pointed to; this is done automatically by pointer(). If a pointer points to an array, its elements can be read and written using standard subscript and slice accesses. Po... | python.library.ctypes#ctypes._Pointer |
contents
Returns the object to which to pointer points. Assigning to this attribute changes the pointer to point to the assigned object. | python.library.ctypes#ctypes._Pointer.contents |
_type_
Specifies the type pointed to. | python.library.ctypes#ctypes._Pointer._type_ |
class ctypes._SimpleCData
This non-public class is the base class of all fundamental ctypes data types. It is mentioned here because it contains the common attributes of the fundamental ctypes data types. _SimpleCData is a subclass of _CData, so it inherits their methods and attributes. ctypes data types that are not... | python.library.ctypes#ctypes._SimpleCData |
value
This attribute contains the actual value of the instance. For integer and pointer types, it is an integer, for character types, it is a single character bytes object or string, for character pointer types it is a Python bytes object or string. When the value attribute is retrieved from a ctypes instance, usuall... | python.library.ctypes#ctypes._SimpleCData.value |
curses — Terminal handling for character-cell displays The curses module provides an interface to the curses library, the de-facto standard for portable advanced terminal handling. While curses is most widely used in the Unix environment, versions are available for Windows, DOS, and possibly other systems as well. This... | python.library.curses |
curses.ascii — Utilities for ASCII characters The curses.ascii module supplies name constants for ASCII characters and functions to test membership in various ASCII character classes. The constants supplied are names for control characters as follows:
Name Meaning
NUL
SOH Start of heading, console interrupt
... | python.library.curses.ascii |
curses.ascii.alt(c)
Return the 8-bit character corresponding to the given ASCII character (the character bit value is bitwise-ored with 0x80). | python.library.curses.ascii#curses.ascii.alt |
curses.ascii.ascii(c)
Return the ASCII value corresponding to the low 7 bits of c. | python.library.curses.ascii#curses.ascii.ascii |
curses.ascii.controlnames
A 33-element string array that contains the ASCII mnemonics for the thirty-two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the mnemonic SP for the space character. | python.library.curses.ascii#curses.ascii.controlnames |
curses.ascii.ctrl(c)
Return the control character corresponding to the given character (the character bit value is bitwise-anded with 0x1f). | python.library.curses.ascii#curses.ascii.ctrl |
curses.ascii.isalnum(c)
Checks for an ASCII alphanumeric character; it is equivalent to isalpha(c) or
isdigit(c). | python.library.curses.ascii#curses.ascii.isalnum |
curses.ascii.isalpha(c)
Checks for an ASCII alphabetic character; it is equivalent to isupper(c) or
islower(c). | python.library.curses.ascii#curses.ascii.isalpha |
curses.ascii.isascii(c)
Checks for a character value that fits in the 7-bit ASCII set. | python.library.curses.ascii#curses.ascii.isascii |
curses.ascii.isblank(c)
Checks for an ASCII whitespace character; space or horizontal tab. | python.library.curses.ascii#curses.ascii.isblank |
curses.ascii.iscntrl(c)
Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f). | python.library.curses.ascii#curses.ascii.iscntrl |
curses.ascii.isctrl(c)
Checks for an ASCII control character (ordinal values 0 to 31). | python.library.curses.ascii#curses.ascii.isctrl |
curses.ascii.isdigit(c)
Checks for an ASCII decimal digit, '0' through '9'. This is equivalent to c in string.digits. | python.library.curses.ascii#curses.ascii.isdigit |
curses.ascii.isgraph(c)
Checks for ASCII any printable character except space. | python.library.curses.ascii#curses.ascii.isgraph |
curses.ascii.islower(c)
Checks for an ASCII lower-case character. | python.library.curses.ascii#curses.ascii.islower |
curses.ascii.ismeta(c)
Checks for a non-ASCII character (ordinal values 0x80 and above). | python.library.curses.ascii#curses.ascii.ismeta |
curses.ascii.isprint(c)
Checks for any ASCII printable character including space. | python.library.curses.ascii#curses.ascii.isprint |
curses.ascii.ispunct(c)
Checks for any printable ASCII character which is not a space or an alphanumeric character. | python.library.curses.ascii#curses.ascii.ispunct |
curses.ascii.isspace(c)
Checks for ASCII white-space characters; space, line feed, carriage return, form feed, horizontal tab, vertical tab. | python.library.curses.ascii#curses.ascii.isspace |
curses.ascii.isupper(c)
Checks for an ASCII uppercase letter. | python.library.curses.ascii#curses.ascii.isupper |
curses.ascii.isxdigit(c)
Checks for an ASCII hexadecimal digit. This is equivalent to c in
string.hexdigits. | python.library.curses.ascii#curses.ascii.isxdigit |
curses.ascii.unctrl(c)
Return a string representation of the ASCII character c. If c is printable, this string is the character itself. If the character is a control character (0x00–0x1f) the string consists of a caret ('^') followed by the corresponding uppercase letter. If the character is an ASCII delete (0x7f) th... | python.library.curses.ascii#curses.ascii.unctrl |
curses.baudrate()
Return the output speed of the terminal in bits per second. On software terminal emulators it will have a fixed high value. Included for historical reasons; in former times, it was used to write output loops for time delays and occasionally to change interfaces depending on the line speed. | python.library.curses#curses.baudrate |
curses.beep()
Emit a short attention sound. | python.library.curses#curses.beep |
curses.can_change_color()
Return True or False, depending on whether the programmer can change the colors displayed by the terminal. | python.library.curses#curses.can_change_color |
curses.cbreak()
Enter cbreak mode. In cbreak mode (sometimes called “rare” mode) normal tty line buffering is turned off and characters are available to be read one by one. However, unlike raw mode, special characters (interrupt, quit, suspend, and flow control) retain their effects on the tty driver and calling prog... | python.library.curses#curses.cbreak |
curses.color_content(color_number)
Return the intensity of the red, green, and blue (RGB) components in the color color_number, which must be between 0 and COLORS - 1. Return a 3-tuple, containing the R,G,B values for the given color, which will be between 0 (no component) and 1000 (maximum amount of component). | python.library.curses#curses.color_content |
curses.color_pair(pair_number)
Return the attribute value for displaying text in the specified color pair. Only the first 256 color pairs are supported. This attribute value can be combined with A_STANDOUT, A_REVERSE, and the other A_* attributes. pair_number() is the counterpart to this function. | python.library.curses#curses.color_pair |
curses.curs_set(visibility)
Set the cursor state. visibility can be set to 0, 1, or 2, for invisible, normal, or very visible. If the terminal supports the visibility requested, return the previous cursor state; otherwise raise an exception. On many terminals, the “visible” mode is an underline cursor and the “very v... | python.library.curses#curses.curs_set |
curses.def_prog_mode()
Save the current terminal mode as the “program” mode, the mode when the running program is using curses. (Its counterpart is the “shell” mode, for when the program is not in curses.) Subsequent calls to reset_prog_mode() will restore this mode. | python.library.curses#curses.def_prog_mode |
curses.def_shell_mode()
Save the current terminal mode as the “shell” mode, the mode when the running program is not using curses. (Its counterpart is the “program” mode, when the program is using curses capabilities.) Subsequent calls to reset_shell_mode() will restore this mode. | python.library.curses#curses.def_shell_mode |
curses.delay_output(ms)
Insert an ms millisecond pause in output. | python.library.curses#curses.delay_output |
curses.doupdate()
Update the physical screen. The curses library keeps two data structures, one representing the current physical screen contents and a virtual screen representing the desired next state. The doupdate() ground updates the physical screen to match the virtual screen. The virtual screen may be updated b... | python.library.curses#curses.doupdate |
curses.echo()
Enter echo mode. In echo mode, each character input is echoed to the screen as it is entered. | python.library.curses#curses.echo |
curses.endwin()
De-initialize the library, and return terminal to normal status. | python.library.curses#curses.endwin |
curses.erasechar()
Return the user’s current erase character as a one-byte bytes object. Under Unix operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself. | python.library.curses#curses.erasechar |
curses.ERR
Some curses routines that return an integer, such as getch(), return ERR upon failure. | python.library.curses#curses.ERR |
exception curses.error
Exception raised when a curses library function returns an error. | python.library.curses#curses.error |
curses.filter()
The filter() routine, if used, must be called before initscr() is called. The effect is that, during those calls, LINES is set to 1; the capabilities clear, cup, cud, cud1, cuu1, cuu, vpa are disabled; and the home string is set to the value of cr. The effect is that the cursor is confined to the curr... | python.library.curses#curses.filter |
curses.flash()
Flash the screen. That is, change it to reverse-video and then change it back in a short interval. Some people prefer such as ‘visible bell’ to the audible attention signal produced by beep(). | python.library.curses#curses.flash |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.