write os.system generated message to csv-file
Asked by
Peter Samulat
I like to add a row to an existing csv-file. The row should contain a timestamp (t1), text information and a numeric value (t2). t1 is right now always zero, so my first question is how to get the message "2014-01-14 18:42:07" into t1 or into the csv-row itself?
t1=os.system("echo $(date +'%Y-%m-%d %H:%M:%S')")
t2=567
with open('eggs.csv', 'wb') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=',',
spamwriter.
Second question: this script is always creating a new csv-file "eggs-csv" with only one row. But I need to add this row to an existing file. What do i have to change?
Peter
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply:
To post a message you must log in.