内置的装饰器和普通的装饰器原理是一样的,只不过返回的不是函数,而是类对象,所以更难理解一些. @property 在了解这个装饰器前,你需要知道在不使用装饰器怎么写一个属性. def getx(self): return self._x def setx(self, value): self._x = value def delx(self): del self._x # create a property x = property(getx, setx, delx, "I am doc for…
使用内置浏览器必须是引用源码的方式(因为jar中不能打包布局文件等资源).内置浏览器是一个继承自BaseActivity的普通Activity,使用WebView实现. 1.简单的打开内置浏览器 Intent i = new Intent(this,BrowserActivity.class); i.putExtra("url", "http://www.baidu.com/"); startActivity(i); 2.设置浏览器主题 Intent i = new…
''' Python --version :Python 2.7.11 Quote : https://docs.python.org/2/tutorial/datastructures.html#more-on-lists Add by camel97 2017-04 ''' 1.filter() #filter(function, sequence) returns a sequence consisting of those items from the sequence for whic…
一.列表生成式 生成1-100的列表 li = [] for i in range(1,101): li.append(i) print(li) 执行输出: [1,2,3...] 生成python1期~11期 li = [] for i in range(1,12): li.append('python'+str(i)+'期') print(li) 执行输出: ['python1期', 'python2期', 'python3期'...] 第二种写法 li = [] for i in range…