On Sat, Sep 15, 2012, Viesturs Lācis <viesturs.la...@gmail.com> wrote > What is the syntax to put current date in the file name. In Your > example the file name is xyz.
import datetime open("xyz."+datetime.date.today().isoformat(),"a") > And how can I specify the folder, in which the file is saved? directory="/tmp/" open(directory+"xyz."+datetime.date.today().isoformat(),"a") Having said that, Stephen's suggestion about databases is cool if you are willing to invest in learning them. A lot of issues such as 'will the data be saved', 'what happens if we restart after power loss', 'which file is the latest one', are handled by the database: you write EVERY data point, the database makes sure it finds its way to disk, and you then use the database to sift good/relevant records out. If you don't feel like running full MySQL system, you could run sqlite: import sqlite3 conn=sqlite3.connect("example.db") c=conn.cursor() c.execute('create table planks (date text, length real)') c.execute('insert into planks values (\''+datetime.date.today().isoformat()+'\',12.44)') conn.commit() c.close() and the data is there: $ sqlite3 -line example.db 'select * from planks' date = 2012-09-15 length = 12.44 length = 12.44 ------------------------------------------------------------------------------ How fast is your code? 3 out of 4 devs don\\\'t know how their code performs in production. Find out how slow your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219672;13503038;z? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users