View Single Post
Posts: 771 | Thanked: 393 times | Joined on Feb 2012
#235
Originally Posted by ataristic View Post
The \x00 is an escape code and must be inside a string literal (that is, inside a quoted piece of text). You can also use the chr() function to get a zero byte. Try the following:
Code:
#!/usr/bin/python
import datetime
seconds = int(float(open('/proc/uptime').read().split()[0]))
print str(datetime.timedelta(0, seconds))[:-3]+chr(0)
this works..thanks! pardon for my knowledge on python :<
__________________
5800XMN8808N9