def run_cmd(cmd): """执行CMD命令""" p = subprocess.Popen(cmd, stdout=subprocess.PIPE) return [i.decode() for i in p.communicate()[0].splitlines()]
def get_apk_info(): """获取apk的package,activity名称 :return: list eg ['com.android.calendar', 'com.meizu.flyme.calendar.AllInOneActivity'] """ result = run_cmd("adb shell dumpsys activity top") for line in result: if line.strip().startswith('ACTIVITY'): return line.split()[1].split('/') print(get_apk_info())
:param path: 根目录 :param suffixes: 指定查找的文件后缀名 :param traverse: 如果为False,只遍历一层目录 :return: """ file_list = [] for root, dirs, files in os.walk(path): for file in files: file_suffix = os.path.splitext(file)[1][1:].lower() # 后缀名 if file_suffix in suffixes: file_list.append(os.path.join(root, file)) if not traverse: return file_list
return file_list
if __name__ == '__main__':
keyword = "XXX宝箱"
files = get_files_by_suffix(r"C:\project\config")
for file in files:
with open(file, 'r', encoding='utf-8', errors='ignore') as f: content = f.read().lower() position = content.find(keyword.lower())
if position != -1: print("Find in {0}".format(file)) start = position - 100 if position - 100 > 0 else 0 end = position + 100 if position + 100 < len(content) else len(content) print(content[start:end]) print("_" * 100) 操作远程服务器
sql = "select * from Player where name like '%{0}%'".format(player_name) # 模糊搜索,从玩家名称搜索玩家ID cur.execute(sql) for r in cur.fetchall(): sql = "select * from Account where uid = '{0}'".format(r[0]) # 从玩家ID搜索玩家帐号 cur.execute(sql) for row in cur.fetchall(): print('{0}, {1}, {2}'.format(r[0], r[1], row[2])) # 打印相关信息
CMS概述
并发标记清理垃圾回收(Concurrent Mark and Sweep GC)算法的主要目标是在GC过程中,减少暂停用户线程的次数以及在不得不暂停用户线程的请夸功能,尽可能短的暂停用户线程的时间。这对于交互式应用,比如web应用来说,是非常重要的。
CMS垃圾回收针对新生代和老年代采用不同的策略。相比同吞吐量垃圾回收,它要复杂的多。吞吐量垃圾回收在执
1,找到配置文件
vi /etc/sysconfig/iptables
2,添加端口开放,增加一行,开放18081端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 18081 -j ACCEPT
3,保存
ESC
:wq!
4,重启服务
service iptables
使用Android SDK Manager 更新了Anadroid SDK Tooks 之后,
打开eclipse提示 This Android SDK requires Android Developer Toolkit version 23.0.0 or above, 点击Check for Updates
检测一会后提示 No update were found