0
我需要複製一個變量並對其進行更改。 我已經看過this,但我想要相反。 在這段代碼中,我需要返回的元組是兩個不同的列表,不一樣。編輯一個變量而不編輯原點
def getIPRange(self):
group = [0, self.getJoinedNetworks() - 1]
while True:
if self.ip[2] > group[0] and self.ip[2] < group[1]:
res_ip_min = self.ip #self.ip is for example [70, 30, 20, 0]
res_ip_min[2] = group[0]
res_ip_min[3] = 1
res_ip_max = self.ip
res_ip_max[2] = group[1]
res_ip_max[3] = 254
return (res_ip_min, res_ip_max)
else:
group[0] = group[1] + 1
group[1] = group[0] + self.getJoinedNetworks() - 1
我要去試試。謝謝 – gcq 2013-02-12 20:15:43