目前公司主要开发安卓平台的APP,平时测试经常需要使用monkey测试,所以尝试了下用python调用monkey,代码如下: import os apk = {'j': 'com.***.test1', 'h': 'com.***.test2'} print 'enter \'j\' to test test1' print 'enter \'h\' to test test2' #choose apk while True: test_apk = raw_input('which apk d
Python调用C库 Python可以利用ctypes库很方便地调用C的库函数. C库例程: # file: a.c int sum(int a, int b){ int t = 0; int i = 0; for(; i < b;i++) t += a; return t; } shell> gcc -fPIC -g -c -Wall a.c && gcc -shared -Wl,-soname,liba.so -o liba.so a.o Python程