我有一些python图形。在
最后,我将绘图保存到png文件中。
代码如下:plt.scatter(LuxCoordinates, finalPix, linewidths=1)
plt.sca
plt.grid(axis)
plt.xlabel('Ambient', color='r');
plt.ylabel('Depth Grows', color='r'); # grayscale color
plt.title(PngName, color='b');
savefig(PngName+'.png'); #PngName is the name of the file that the user gives in argv
这项工作做得很好,它为我保存了一个文件,名字PngName.png(其中PngName是用户决定的)
现在我想给这个名字加上当前日期。
我试过这么做:
^{pr2}$
但它不起作用,我收到了一条错误消息:filename_or_obj = open(filename_or_obj, 'wb')
IOError: [Errno 2] No such file or directory: '05/12/2013.png'
可以看到date变量获取日期。(当我把它打印到屏幕上时,我会看到日期)
问题是什么?我如何解决?在
谢谢!在