You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/st.py

26 lines
528 B
Python

import socket
def GetCurrentHostname():
'''
Fetch the current hostname.
'''
return socket.gethostname()
def LogCurrentUptime(hostname, pathname='/tmp/uptime.txt'):
'''
Log the current uptime along with process ID that logs it.
Args:
hostname: the string hostname.
'''
fp = file(pathname, 'a')
fp.write('%d %s %s\n' % (os.getpid(), hostname, os.popen('uptime').read()))
fp.close()
def try_something_silly(arg):
file('tty', 'w').write('ARG WAS: ' + str(arg) + '\n')