473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Whether "structure" concept is available

440 256MB
Hi,

Whether we have "structure" concept available.I have to create a different datatypes to be stored.

Say in C/C++ we use

struct Point{

int PntID;
double xCoord;
double yCoord
double zCoord
bool bFlag;
};

Similarly in Python without using "class" / list definition,is it psosible to store/access the different datatypes

Thanks
PSB
Apr 18 '07 #1
2 1197
bartonc
6,596 Expert 4TB
Hi,

Whether we have "structure" concept available.I have to create a different datatypes to be stored.

Say in C/C++ we use
Expand|Select|Wrap|Line Numbers
  1. struct Point{
  2.  
  3. int PntID;
  4. double xCoord;
  5. double yCoord
  6. double zCoord
  7. bool bFlag;
  8. };
Similarly in Python without using "class" / list definition,is it psosible to store/access the different datatypes

Thanks
PSB
ONLY IF you must pass this structure to a function written in C, you can use the ctypes module and subclass ctypes.Structure().

OTHERWISE use a class.
Apr 19 '07 #2
bartonc
6,596 Expert 4TB
ONLY IF you must pass this structure to a function written in C, you can use the ctypes module and subclass ctypes.Structure().

OTHERWISE use a class.
In version 2.4 and 2.5 there's also this:
4.3 struct -- Interpret strings as packed binary data
in the Python Library Reference.
Apr 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
4
by: Mikkel christensen | last post by:
Hi there I wonder if any of you could point me in a direction where I can find some usefull information about coding standarts. I have some generel experiense in programming but I lack many...
2
by: Zhaozhi Gao | last post by:
I'm doing a simple project for school. This is the first time I've ever used Access. Is there a way i can simulate a Circular Queue data structure for the datas in a table. I tried assign index...
3
by: Leo Nunez | last post by:
Hello! I need copy from structure "A" to "B" that contains "strings" in a one line code. Me problem like this : typedef struct tHeader{ char field1; char field2; char field3;
0
by: shengmin.ruan | last post by:
i got a struct like: --------------------- public ref struct OutPacket{ int m_replyIndex; List<MainInfo^>^ m_mainInfos; }; --------------------- when i pass it to another process, i have...
0
by: tommak | last post by:
It's a dream of human beings to build machines that can think and behave like human beings. The most important part of of such a machine is an artificial mind that can emulate the cognitive...
3
by: darkenergy | last post by:
Hi all, I want to do a similar thing as class inheritance in C++, but with structures in C. I have a structure A, and I want to define a second structure B (in different .h/.c files), which has...
0
by: Joe HM | last post by:
Hello - I have a *.dll that was compiled from Ada. The following declaration and Structure is working ... Declare Sub XXX Lib "X.dll" (ByRef XState As XStructure) ...
2
by: alwaali | last post by:
Hi I need help please This is my project and i need a help to solve it with you A page of text is to be read and analyzed to determine number of occurrences and locations of different words. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.