Python首部格式
#!/usr/bin/env python # encoding: utf-8 if __name__ == ‘__main__‘:
日志记录
记录到 /var/log/messages
#/usr/bin/env python #-*-coding:utf8-*- import syslog if __name__=="__main__": syslog.openlog("TestHCN") syslog.syslog("test by hcn")
查看:
# tail -n 50 /var/log/messages
dd
时间: 2024-10-13 08:20:14