While executing the below script in the interactive prompt, there is an additional 0 is returned. Why is that 0 there?
>>> import os
>>> os.system('date')
Sun Oct 2 19:20:29 IST 2016
0
While executing the below script in the interactive prompt, there is an additional 0 is returned. Why is that 0 there?
>>> import os
>>> os.system('date')
Sun Oct 2 19:20:29 IST 2016
0
Thats the exit status of the program, 0
normally means the program finished without error.
You are performing a system call. 0 is the return code of this call. If you are trying to just get the current time use: datetime.datetime.now()