Create file named readfile.py
#!/usr/bin/python
import os
try:
t = os.popen('uptime').read()[:-1]
#print(t)
f=open("/home/directory/public_html/public/load.txt", "a+")
f.write("%s\r\n" %t)
f.close()
f.flush()
except IOError as (errno,strerror):
print "I/O error({0}): {1}".format(errno, strerror)
run python file
$ python readfile.py