Re: Python : writing to a file

2015-01-11 Thread Dave Angel
You accidentally did a Reply instead of a Reply-List. So the email came to me and not to the list. if your mail program doesn't support reply-list, do a reply-all and remove the personal addresses. The list is what's important here. On 01/11/2015 12:20 AM, Ganesh Pal wrote: On Sat, Jan

Re: Python : writing to a file

2015-01-11 Thread Peter Otten
Ganesh Pal wrote: On Sun, Jan 11, 2015 at 2:17 PM, Dave Angel da...@davea.name wrote: You chopped off the output there. It probably looked like this: node-1# cat test_2.txt Sundaynode-1# Your output is there, right before the prompt. Since you neglected the newline in your code,

Re: Python : writing to a file

2015-01-11 Thread Ganesh Pal
On Sun, Jan 11, 2015 at 2:17 PM, Dave Angel da...@davea.name wrote: You chopped off the output there. It probably looked like this: node-1# cat test_2.txt Sundaynode-1# Your output is there, right before the prompt. Since you neglected the newline in your code, that's what you'd

Re: Python : writing to a file

2015-01-10 Thread Steven D'Aprano
Ganesh Pal wrote: Throttling-1# cat test_2.txt Are you running these scripts as root? That could be a bad idea. If you have a bug in your code, as often happens when coding, who knows what it might do. E.g. if you put in the wrong pathname, you could overwrite important files. You should always

Re: Python : writing to a file

2015-01-10 Thread Dave Angel
On 01/10/2015 10:14 AM, Ganesh Pal wrote: Please provide you input on the below questions: For each new thread, you should specify at a minimum your Python version and OS. it frequently matters, and it's better to specify than to have everyone try to guess. I'll assume Python 2.7 and

Python : writing to a file

2015-01-10 Thread Ganesh Pal
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)