I have some graph that I do in python.
In the end I save the plot to a png file. Here is the code:
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
This work good and it save me a file, name PngName.png (Where PngName is what the user decided)
Now I want to add to that name the current date. I had try to do this:
date = time.strftime("%d/%m/%Y")
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+'_'+date+'.png')
But it's not working, I get this error message:
filename_or_obj = open(filename_or_obj, 'wb') IOError: [Errno 2] No such file or directory: '05/12/2013.png'
You can see that the date variable get the date. (also when I'm printing it to screen I see the date)
What is the problem and how can I solve it?
Thanks!