Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.5K+ articles
Python
19.6K+ articles
Experiences
15.8K+ articles
Interview Experiences
14.5K+ articles
School Learning
11.1K+ articles
JavaScript
9.9K+ articles
Marketing
2.0K+ articles
python-utility
680+ articles
python-input-output
14+ articles
Python-ctype
27 posts
Recent Articles
Python unittest - How to nicely mock a web crawler function?
Last Updated: 23 July 2025
Prerequisite: Python | Unit Test Objects PatchingUnit Testing is the first level of software testing where the smallest testable parts of the software are tested. This is ...
read more
Python
Picked
python-modules
Python-ctype
Python | Accepting Script Input
Last Updated: 12 June 2019
A lot of people use Python as a replacement for shell scripts, using it to automate common system tasks, such as manipulating files, configuring systems, and so forth. Thi...
read more
Python
python-utility
python-input-output
Python-ctype
Python | Unit Test Objects Patching | Set-2
Last Updated: 12 June 2019
MagicMock instances that are normally used as replacement values are meant to mimic callables and instances. They record information about usage and allow to make assertio...
read more
Python
Python-ctype
Python | Unit Test Objects Patching | Set-1
Last Updated: 12 June 2019
The problem is writing unit tests and need to apply patches to selected objects in order to make assertions about how they were used in the test (e.g., assertions about be...
read more
Python
Python-ctype
Python | Passing Filenames to Extension in C
Last Updated: 07 June 2019
Filename has to be encoded according to the system’s expected filename encoding before passing filenames to C library functions.Code #1 : To write an extension function th...
read more
Python
Python-ctype
Python | Consuming an Iterable and Diagnosing faults in C
Last Updated: 07 June 2019
The article aims to write C extension code that consumes items from any iterable object such as a list, tuple, file, or generator.Code #1 : C extension function that shows...
read more
Python
Python-ctype
Reading Python File-Like Objects from C | Python
Last Updated: 07 June 2019
Writing C extension code that consumes data from any Python file-like object (e.g., normal files, StringIO objects, etc.). read() method has to be repeatedly invoke to con...
read more
Python
Python-ctype
Python | C Strings of Doubtful Encoding | Set-2
Last Updated: 07 June 2019
String handling in extension modules is a problem. C strings in extensions might not follow the strict Unicode encoding/decoding rules that Python normally expects. Thus, ...
read more
Python
Python-ctype
Python | C Strings of Doubtful Encoding | Set-1
Last Updated: 07 June 2019
One can convert strings between C and Python vice-versa but the C encoding is of a doubtful or unknown nature. Let's suppose that a given C data is supposed to be UTF-8, b...
read more
Python
Python-ctype
Turning a Function Pointer to Callable
Last Updated: 02 April 2019
Well, the memory address of a compiled function is obtained but how to turn it to Python callable that can be used as an extension. The answer to this the use of ctypes mo...
read more
Python
Python-ctype
C strings conversion to Python
Last Updated: 02 April 2019
For C strings represented as a pair char *, int, it is to decide whether or not - the string presented as a raw byte string or as a Unicode string. Byte objects can be bu...
read more
Python
Python-ctype
Unicode Strings Passing to C Libraries
Last Updated: 02 April 2019
Given that one wants to write an extension module that needs to pass a Python string to C library function. So, the question arises to properly handle Unicode. So, one of ...
read more
Python
Python-ctype
Passing NULL-Terminated Strings to C Libraries
Last Updated: 29 March 2019
If one wants an extension module that needs to pass a NULL-terminated string to a C library. Let's see how to do it with Python's Unicode string implementation. C librarie...
read more
Python
Python-ctype
High-Performance Array Operations with Cython | Set 2
Last Updated: 11 July 2025
The resulting code in the first part works fast. In this article, we will compare the performance of the code with the clip() function that is present in the NumPy library...
read more
Python
Python-ctype
High-Performance Array Operations with Cython | Set 1
Last Updated: 29 March 2019
Although libraries like NumPy can perform high-performance array processing functions to operate on arrays. But Cython can also work really well. But how ? Code #1 : Cytho...
read more
Python
Python-ctype
1
2