摘要:
#!usr/bin/env python# -*- coding:utf-8 -*-__author__ = "Samson"import multiprocessingimport timedef run(name): time.sleep(2) print("process start...%s 阅读全文
摘要:
#!usr/bin/env python# -*- coding:utf-8 -*-__author__ = "Samson"import threading,timedef run(n): print("task", n) time.sleep(2) print("current thread:" 阅读全文
摘要:
socket_server_ssh.py socket_server_client.py 阅读全文
摘要:
socket_client.py socket_server.py 阅读全文
摘要:
#!usr/bin/env python# -*- coding:utf-8 -*-__author__ = "Samson"class Foo: '''描述类的信息''' country = "China" def __init__(self,name): self.name = name def 阅读全文
摘要:
#!usr/bin/env python# -*- coding:utf-8 -*-__author__ = "Samson"class Dog(object): def __init__(self,name): self.name = name #@staticmethod#静态方法,实际上访问不 阅读全文
摘要:
#!usr/bin/env python# -*- coding:utf-8 -*-__author__ = "Samson"###类变量与实例变量class Role: n = 123#类变量,存放在类中,不存放在实例中,可用于节省空间 def __init__(self, name, role, 阅读全文
摘要:
'.' 默认匹配除\n之外的任意一个字符,若指定flag DOTALL,则匹配任意字符,包括换行'^' 匹配字符开头,若指定flags MULTILINE,这种也可以匹配上(r"^a","\nabc\neee",flags = re.MULTILINE)'$' 匹配字符结尾,或e.search("f 阅读全文