我有这两个嵌套的结构在下面C你如何重建这些结构在Python
typedef struct tag_interest {
float *high;// array
float *low;// array
} sinterest;
typedef struct tag_sfutures {
int time;
float result;
sinterest *interest;// array
} sfutures;
有什么相当于在Python?
编辑 我试过了。我还没有解析和检查,因为我仍然在调试之前的一些代码。
class CInterest(object):
high = []
low = []
def add_high(self,High):
self.high.append(High)
def add_low(self,Low):
self.low.append(Low)
class CFutures(object):
interest = [CInterest]
def add_interest(self,interest):
self.interest.append(interest)
def set_time(self,time):
self.time = time
def set_put(self,put):
self.put = put
@soon请参阅编辑 – ssn