Please provide you input on the below questions:

(a) I was expecting  the string i.e day of week , example Saturday to be
written in the file. what Iam I missing in the below program  ?

Program:

#!/usr/bin/python

import time
f = open ('test_2.txt','w+b')
DAY = time.strftime("%A")
f.write(DAY)
f.close()

Throttling-1# cat test_2.txt

(b) Iam trying to generate a file in the below format ,

cluster1# cat test_2.txt

Saturday 0:05 0:10
Saturday 0:10 0:20
Saturday 0:20 0:30
Saturday 0:40 0:50
Saturday 0:60 0:70

(a) what is the easiest way to generate the above file fprmat ?

(b) how will I take care that the below format is repeated in the .txt file
  ( i.e column and row spacing)

    DAY OF THE WEEK  [SPACE] START TIME [ SPACE] ENDTIME{SPACE]


(c) how do I  add START TIME [ SPACE] ENDTIME{SPACE] columns



Regards,
Ganesh
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to