#coding=utf-8 import os command = 'ping www.baidu.com ' #可以直接在命令行中执行的命令 r = os.popen(command) #执行该命令 info = r.readlines() #读取命令行的输出到一个list for line in info: #按行遍历 line = line.strip('\r\n') print line ----------------------------------…
https://www.cnblogs.com/captain_jack/archive/2011/01/11/1933366.html zzz.py import sys from optparse import OptionParser filelist = ["/home/an/a","/home/an/b"] def main(filelist,tmpfile=None): for filename in filelist: with open(filena…
In [17]: now.strftime(%a),now.strftime(%w) Out[17]: ('Mon', '1') Directive Meaning %a Weekday name. %A Full weekday name. %b Abbreviated month name. %B Full month name. %c Appropriate date and time representation. %d Day of the month as a decimal num…
1,针对mysql操作 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass'); 设置密码 update user set password=passworD("test") where user='root';修改密码 flush privileges; grant all on *.* to root@'%' identified by 'your_password'; mysql> select user,pass…