修改一个变量

时间:2015-06-26 14:15:09

标签: python function

我在一个saperated文件中定义了distGPX函数,然后将其导入到我的主文件中。

def distGPX(Date, Distance):

    Date1, Distance1 = Date, Distance

    size = len(GPX1)

    for n in range(0, size):
        if '.gpx' not in GPX1[size - n - 1]:

            Date1.pop(size - n - 1)
            Distance1.pop(size - n - 1)


    return Date1, Distance1

在主文件中,我以这种方式调用函数

newDate, newDistance = distGPX(Date, Distance)

其中日期和距离未更改。问题是在主程序变量中,Date和Distance的更改方式与Date1和Distance1相同。

任何人都可以解释我的问题吗?

0 个答案:

没有答案