此代码在调用时不创建文件。你知道吗
def editcam(filetext, filename, x, y, z):
print 'opening file'
filetext=re.sub(r'location <(\d+),(\d+),(\d+)>', 'location <%d,%d,%d>'%
(x,y,z), filetext)
fout=open(filename, 'w')
print 'file opened'
fout.write(filetext)
fout.close()
return
def main():
editcam(getfile(),'tmp.pov',0,0,12)
return
两个指纹都不起作用。没有错误消息。getfile()应该返回一个字符串。我试着把这个问题说出来回复sub调用并用硬编码字符串替换getfile()。都没改变什么。由于打印不起作用,因此似乎该方法甚至没有被调用。有什么想法吗?你知道吗
我能用下面的代码让它工作。你知道吗
相关问题 更多 >
编程相关推荐