12 2012 档案
摘要:由于Python的datetime和time中的_strptime方法不支持多线程,运行时会报错:import datetimeimport threadimport timedef f(): datetime.datetime.strptime("20100101","%Y%m%d")for _ in xrange(3): thread.start_new_thread(f, ())time.sleep(3)Unhandled exception in thread started by <function f at 0x2b52c24e66e0
阅读全文
摘要:在配置有多个网络接口的设备时我们会犯难,eth0、eth1、……到底是那个接口?今天为大家介绍一个小工具,ethtool,他可以帮助你解决这个问题。我使用的机器是Fedora Linux 系统,打开终端,输入ethtool --help 显示帮助信息,下面我就简要介绍一下最常用的两个功能。功能1ethtool DEVNAME 查看相应设备名称对应的设备信息使用方法如下:ethtool eth3回车后显示如下图所示的信息。显示了eth3 的接口类型,连接模式,速率等等信息,方便你找到相应的网卡。(如果是网线Supported ports 就是TP,如果是光纤则显示Fiber)功能2ethtool
阅读全文