码迷,mamicode.com
首页 >  
搜索关键字:self    ( 14215个结果
python复习-单例模式
#单例模式,比如数据库对象,实例化时参数都一样,就没必要重复产生对象,浪费内存 class Mysql: __instance=None def __init__(self,host='127.0.0.1',port='3306'): self.host=host self.port=port @c... ...
分类:编程语言   时间:2017-10-04 14:32:40    阅读次数:234
博客园登录--selenium+python
# coding:utf-8 from selenium import webdriver import unittest class CnBlog(unittest.TestCase): def setUp(self): self.driver=webdriver.Firefox() self.u... ...
分类:编程语言   时间:2017-10-03 14:33:24    阅读次数:275
unity------------------------------transform.forward与Vector.forward的区别
在unity3d中有2个forward,一个是vector3.forward和transform.forward,这两个forward其实完全不一样。他们之间的区别主要体现在在不同坐标系时的反映上。 我们分别对比一下 vector3和transform两个向量的forward 在 self自身坐标系 ...
分类:编程语言   时间:2017-10-03 12:38:07    阅读次数:285
【POJ】1704 Georgia and Bob(Staircase Nim)
Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, .. ...
分类:其他好文   时间:2017-10-02 22:23:55    阅读次数:169
洛谷P2970 [USACO09DEC]自私的放牧Selfish Grazing
洛谷P2970 [USACO09DEC]自私的放牧Selfish Grazing 一道贪心题 ...
分类:其他好文   时间:2017-10-02 21:29:00    阅读次数:218
10.02经典类的bug
#以下在python 3.6版本里已没有这个问题了1class A: def _init__(self): print ("this is A") def save(self): print ("save metho from A")class B(A): def _init__(self): pr ...
分类:其他好文   时间:2017-10-02 17:19:24    阅读次数:112
10.02新式类与经典类的区别
class Father(object): #有object就是新式类,没有object就是经典类,新式类修正了一 些bug。 def __int__(self): self.Fname = "ffff" print ("father.__init__") def Func(self): print ...
分类:其他好文   时间:2017-10-02 16:43:23    阅读次数:128
python 简单日志框架 自定义logger
转载请注明: 仰望高端玩家的小清新 http://www.cnblogs.com/luruiyuan/ 通常我们在构建 python 系统时,往往需要一个简单的 logging 框架。python 自带的 logging 框架的确十分完善,但是本身过于复杂,因此需要自行封装来满足我们的高(zhuan ...
分类:编程语言   时间:2017-10-02 00:22:21    阅读次数:219
Python爬虫实例(二)使用selenium抓取斗鱼直播平台数据
程序说明:抓取斗鱼直播平台的直播房间号及其观众人数,最后统计出某一时刻的总直播人数和总观众人数。 过程分析: 一、进入斗鱼首页http://www.douyu.com/directory/all 进入平台首页,来到页面底部点击下一页,发现url地址没有发生变化,这样的话再使用urllib2发送请求将 ...
分类:编程语言   时间:2017-10-01 23:06:05    阅读次数:478
python知识
Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。 1. object类是Python中所有类的基类,如果定义一个类时没有指定继承哪个类,则默认继承object类。 2. object类定义了所有类的一些公共方法。 3. object类没有定义 ...
分类:编程语言   时间:2017-10-01 22:03:47    阅读次数:199
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!