buffer

python ctypes memory read stops at first zero integer

python ctypes memory read stops at first zero integer Question: To all ctypes experts: I am running this code in Python to read 0x400 entries from memory. Unfortunately the returned list only contains ~20 entries. It seems to stop reading at the first entry with the value equal to 0. read_buffer = (ctypes.c_char * buffsize)() …

Total answers: 1

C++ vs Python | Read Memory

C++ vs Python | Read Memory Question: Have working code in C++ and would like to get equivalent results with Python. The idea is to retrieve data from memory using a specific process and a pointer. The result should look like this as it works in C++: Here is the C++ code: hProcess = SOME_HANDLER …

Total answers: 1

How do I use a file like a memory buffer in Python?

How do I use a file like a memory buffer in Python? Question: I don’t know the correct terminology, maybe it’s called page file, but I’m not sure. I need a way to use an on-disk file as a buffer, like bytearray. It should be able to do things like a = buffer[100:200] and buffer[33] …

Total answers: 1

Can you read from serial buffer without knowing baudrate?

Can you read from serial buffer without knowing baudrate? Question: I’m just wondering why it’s necessary to know the baud rate when reading serial data from the buffer with PySerial. Shouldn’t the byte data in the buffer be the same regardless of 9600 or 38400 baud rate, with the exception that the latter fills faster? …

Total answers: 1

Filtering byte stream efficiently before converting to numpy array / pandas dataframe

Filtering byte stream efficiently before converting to numpy array / pandas dataframe Question: I’m looking for guidance on how to efficiently filter out unneeded parts of my data before converting to a numpy array and/or pandas dataframe. Data is delivered to my program as string buffers (each record separately), and I’m currently using np.frombuffer to …

Total answers: 1

Python buffered IO ending early streaming with multiple pipes

Python buffered IO ending early streaming with multiple pipes Question: I’m trying to make a continuous livestream of videos downloaded via yt-dlp. I need to port this (working) bash command into Python. ( youtube-dl -v –buffer-size 16k https://youtube.com/watch?v=QiInzFHIDp4 -o – | ffmpeg -i – -f mpegts -c copy – ; youtube-dl -v –buffer-size 16k https://youtube.com/watch?v=QiInzFHIDp4 …

Total answers: 1

Python socket server read multi command of client

Python socket server read multi command of client Question: I created a socket server to read the commands from a socket client. In client side, I send ABC and then DEF, in server side, each time I received ABC or DEF from client, the server will send back to client OK. Server import socket import …

Total answers: 1

TypeError: coercing to Unicode: need string or buffer, int found

TypeError: coercing to Unicode: need string or buffer, int found Question: I have 2 APIs. I am fetching data from them. I want to assign particular code parts to string so that life became easier while coding. Here is the code: import urllib2 import json urlIncomeStatement = ‘http://dev.c0l.in:8888’ apiIncomeStatement = urllib2.urlopen(urlIncomeStatement) dataIncomeStatement = json.load(apiIncomeStatement) urlFinancialPosition …

Total answers: 2

How to check potentially empty stdin without waiting for input?

How to check potentially empty stdin without waiting for input? Question: I am attempting to read from keyboard input without waiting for input. The purpose is to be used in an "infinite" loop aka while True:. Thus far I’ve been trying to manipulate the readchar library https://pypi.python.org/pypi/readchar/0.6 , but with no luck. While it doesn’t …

Total answers: 1