|
by: Joshua Forgione |
last post by:
Hello. I am reverse engineering some Python Code. I am using the book
"The Quick Python Book" as an aide.
The following line exists in the code:
msg = struct.pack('BBBB',word0, word1, word2, word3, word4)
In this struct.pack command, the format string is 'BBBB.' In the book,
it gives the following examples for characters that are...
|
by: Grant Edwards |
last post by:
Perhaps I'm doing something wrong: the struct module docs say
it's IEE 754, but I can't figure out how to get it to handle
NaN values correctly (either packing or unpacking).
>>> x = float('nan')
>>> struct.pack("<f",x)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
SystemError: frexp() result out of range
|
by: Chandu |
last post by:
In using the following struct format I get the size as 593. The same C
struct is 590 if packed on byte boundary and 596 when using pragma
pack(4). I am using pack(4) and added 3 spares at the end to get by.
hdrFormat = '16s 32s 32s B 8s H 8s H 4s H H 20s 64s 64s 64s 32s 32s
64s L L B B B B B 64s 64s'
Any ideas on what I am doing wrong?
|
by: Alex Stapleton |
last post by:
from struct import pack
>>> pack("B", 1)
'\x01'
>>> pack("BB", 0, 1)
'\x00\x01'
>>> pack("BI", 0, 1)
'\x00\x00\x00\x00\x01\x00\x00\x00'
>>> calcsize("BI")
8
>>> calcsize("BB")
|
by: GeLLcheN |
last post by:
Hello everybody,
I've got a little (endian) problem.
I'm programming a network-based application, in which I'll use structs,
interpreting ethernet packets.
My intention is to read the stream directly and transport to the right
struct. But this seems to be not so simple:
Here's a sample code demonstrating my problem:
|
|
by: rong.xian |
last post by:
Before I was bitten by the difference below, I think these two ways are
the same.
However, they are not.
Is there any geek who can tell me if this is a bug?
(some weird '\x00\x00' was inserted between '0123456789abcd' and 6 )
'\x01\x00\x00\x00%\x910\x01\x0e\x00\x00\x000123456789abcd\x00\x00\x06\x00\x00\x00'...
|
by: Jansson Christer |
last post by:
Hi all,
I have discovered that in my Python 2.4.1 installation (on Solaris 8),
struct.pack handles things in a way that seems inconsistent to me.
I haven't found any comprehensible documentation over known issues with
Python 2.4.1 so I try this...
Here's the thing:
|
by: p.lavarre |
last post by:
Can Python not express the idea of a three-byte int?
For instance, in the working example below, can we somehow collapse the
three calls of struct.pack into one?
08 12 34 56 80 00
I ask because I'm trying to refactor working code that is concise:
08 12 34 56 80 00
|
by: =?Utf-8?B?S2V2?= |
last post by:
Since installing Service Pack 2 my computer will not recognise my HP all in
one printer. Tried uninstalling/reinstalling printer soft ware; disabling
security firewall; changing usb cables but no change. I'm using XP home
edition and had this same problem previously and only resolved it but
deleting SP2 but with Sky internet package SP2 is...
|
by: Joshua J. Kugler |
last post by:
I'm trying to put some values into a struct. Some of these values are NaN
and Inf due to the nature of the data. As you well may know, struct (and
other things) in Python <= 2.4 doesn't support inf and nan float values.
You get the dreaded "SystemError: frexp() result out of range" error.
Before I go and write my own little wrapper, has...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|