第一个问题是
createDestination
从不定义属性
self.new_folder
new_folder
. 缩进也将关闭,因为您希望返回缩进
新文件夹
def createDestination(self):
'''
split the src variable for machine type
and create a folder with 'Evo' - machine
'''
s = src.split('\\')
new_folder = (dst + '\\Evo ' + s[-1])
if not os.path.exists(new_folder):
os.makedirs(new_folder)
return new_folder # not self.new_folder
其次,您从未指定
创建目的地
copyPrograms
作为论据。
def main():
new_folder = createDestination()
copyPrograms(new_folder)
在…内
创建目的地
与中同名的不同
main
主要的
def main():
d = createDestination()
copyPrograms(d)
你甚至都不知道
需要
def main():
copyPrograms(createDestination())