我有這兩個嵌套的結構在下面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