花落_随风 2016-10-10 01:48 采纳率: 0%
浏览 1000
已结题

python大牛们,请拯救下入门级的我,运行别人的程序时,一直报windowserroe:3

File "H:\data_and_plotting_scripts\plotting_scripts\forgetting_bar_chart.py", line 233, in
for folder in os.listdir(fullPath):
WindowsError: [Error 3] : '.cost0wMod/*.*
下面附部分程序:
for folder in os.listdir(fullPath):
if fnmatch.fnmatch(folder, 'run_*'):
runPath = fullPath + "/" + folder

        for file in os.listdir(runPath):
            if fnmatch.fnmatch(file, fileToLookFor):
                numIndividuals+=1
                lines = open(runPath+"/"+file)
                for line in lines:

                    if "Nr of seasons we solve all" in line:
                      if cost:
                        perfectSolveValueswCost.append(float(line.split()[-1]))
                      else:
                        perfectSolveValuesnoCost.append(float(line.split()[-1]))
                    elif "Nr of seasons we forgot something" in line:
                      if cost:
                        forgettingValueswCost.append(float(line.split()[-1]))
                      else:
                        forgettingValuesnoCost.append(float(line.split()[-1]))
                    elif "Nr of items known" in line:
                      if cost:
                        knownItemswCost.append(float(line.split()[-1]))
                      else:
                        knownItemsnoCost.append(float(line.split()[-1]))
                    elif "Nr of items forgotten" in line:
                      if cost:
                        forgottenItemswCost.append(float(line.split()[-1]))
                      else:
                        forgottenItemsnoCost.append(float(line.split()[-1]))
                    elif "Nr of items retained" in line:
                      if cost:
                        retainedItemswCost.append(float(line.split()[-1]))
                      else:
                        retainedItemsnoCost.append(float(line.split()[-1]))
                    elif "Total number of seasons" in line:
                      totalNrOfSeasons = float(line.split()[-1])

print "num individuals for treatment ", treatment, " was ", numIndividuals
  • 写回答

2条回答 默认 最新

  • 花落_随风 2016-10-10 02:23
    关注

    最近一直在关注这个问题,难道是文件位置的原因?

    评论

报告相同问题?

悬赏问题

  • ¥15 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!