在装饰器函数里传入参数 在Python里方法和函数几乎一样.唯一的区别就是方法的第一个参数是一个当前对象的(self) 也就是说你可以用同样的方式来装饰方法!只要记得把self加进去: 如果你想造一个更通用的可以同时满足方法和函数的装饰器,用*args,**kwargs就可以了 把参数传递给装饰器 ...
分类:
编程语言 时间:
2017-12-02 23:19:52
阅读次数:
320
You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres ...
分类:
其他好文 时间:
2017-12-02 17:37:05
阅读次数:
150
1. __construct: 内置构造函数,在对象被创建时自动调用。见如下代码: 运行结果如下: 2. parent: 用于在子类中直接调用父类中的方法,功能等同于Java中的super。 运行结果如下: 3. self: 在类内调用该类静态成员和静态方法的前缀修饰,对于非静态成员变量和函数则使用 ...
分类:
其他好文 时间:
2017-12-02 14:05:54
阅读次数:
190
题目描述 Farmer John has so very many jobs to do! In order to run the farm efficiently, he must make money on the jobs he does, each one of which takes ju ...
分类:
其他好文 时间:
2017-12-02 13:09:38
阅读次数:
136
import tkinter import tkinter.filedialog import zipfile import os import tkinter.messagebox #压缩软件 class zipc: #界面布局方法 def __init__(self): #创建主界面 并保存到成 ...
分类:
其他好文 时间:
2017-12-01 20:43:05
阅读次数:
132
static void Main() { string baseAddress = "http://localhost:4004/"; /*Render application Application.EnableVisualStyles(); Application.SetCompatibleTe ...
import tkinter import math class objc: # 界面布局方法 def __init__(self): # 创建主界面 并且保存到成员属性中 self.root = tkinter.Tk() self.root.minsize(300, 400) self.root. ...
分类:
其他好文 时间:
2017-12-01 20:39:10
阅读次数:
190
PEP8 Python 编码规范,仅供参考,不必完全遵守。 一 代码编排1 缩进。4个空格的缩进(编辑器都可以完成此功能),不使用Tab,更不能混合使用Tab和空格。2 每行最大长度79,换行可以使用反斜杠,最好使用圆括号。换行点要在操作符的后边敲回车。3 类和top-level函数定义之间空两行; ...
分类:
编程语言 时间:
2017-12-01 19:37:36
阅读次数:
166
textView放在自定义cell里面-自适应高度 1,textView有个属性 scrollEnabled 要设置为NO; 2,设置tableview的时候 添加这两行代码: self.tableView.rowHeight = UITableViewAutomaticDimension; sel ...
分类:
其他好文 时间:
2017-12-01 16:39:08
阅读次数:
210
原文:http://cnzhx.net/blog/self-signed-certificate-as-trusted-root-ca-in-windows/ 添加自签发的 SSL 证书为受信任的根证书 发表于 2012-08-09 作者 H Zeng 更新于 2012-09-01 通过 SSL 加 ...
分类:
其他好文 时间:
2017-12-01 15:13:00
阅读次数:
233