摘要:
abs() all() #全真返回True 否则False any() #全假返回False 否则True ascii() #返回 bin() #数字转换2进制 bool() #空返回False 否则返回True bytes('str',encoding="utf-8") #不可修改二进制格式 二进 阅读全文
posted @ 2019-04-18 23:46
潇潇六月雨
阅读(105)
评论(0)
推荐(0)
摘要:
1、定义模块:用来从逻辑上组织python代码(变量、函数、类、逻辑:实现一个功能),本质就是:.py结尾的python文件(文件名:test.py,对应的模块名:test)包:本质就是一个目录(必须带有一个__init__.py文件) 2、导入方法import module_nameimport 阅读全文
posted @ 2019-04-18 23:46
潇潇六月雨
阅读(135)
评论(0)
推荐(0)
摘要:
博客:http://www.cnblogs.com/alex3714/articles/5765046.html 列表生成式 [i*2 for i in range(10)] #创建时就生成,不调用也生成 生成器:( i*2 for i in range(10) ) #创建时记录算法,不调用算法不生 阅读全文
posted @ 2019-04-18 23:45
潇潇六月雨
阅读(140)
评论(0)
推荐(0)
摘要:
首先创建一个模块目录lib,然后在目录内创建一个模块为:aa.py 官方推荐: import importlib aa = importlib.import_module('lib.aa') c = aa.c() print(c) __import__导入方式 lib = __import__('l 阅读全文
posted @ 2019-04-18 23:44
潇潇六月雨
阅读(168)
评论(0)
推荐(0)
摘要:
def test1(): print('in the test1') def test2(): print('in the test2') return 1 def test3(): print('in the test3') return 3,'hello',{'name':'Jason'},[' 阅读全文
posted @ 2019-04-18 23:43
潇潇六月雨
阅读(108)
评论(0)
推荐(0)
摘要:
http://www.cnblogs.com/alex3714/articles/5161349.html 用于加密相关的操作,3.x里代替了md5模块和sha模块,主要提供 SHA1, SHA224, SHA256, SHA384, SHA512 ,MD5 算法 import hashlib m 阅读全文
posted @ 2019-04-18 23:42
潇潇六月雨
阅读(206)
评论(0)
推荐(0)
摘要:
[DEFAULT]ServerAliveInterval = 45Compression = yesCompressionLevel = 9ForwardX11 = yes [bitbucket.org]User = hg [topsecret.server.com]Port = 50022Forw 阅读全文
posted @ 2019-04-18 23:42
潇潇六月雨
阅读(116)
评论(0)
推荐(0)
摘要:
服务器端 import socketimport os server = socket.socket()server.bind(( '127.0.0.1',9999 )) server.listen() #设置最大连接数 while True: conn, addr = server.accept( 阅读全文
posted @ 2019-04-18 23:41
潇潇六月雨
阅读(95)
评论(0)
推荐(0)
摘要:
Python中time模块详解http://qinxuye.me/article/details-about-time-module-in-python/ python模块part3http://blog.51cto.com/egon09/1840425 阅读全文
posted @ 2019-04-18 23:41
潇潇六月雨
阅读(88)
评论(0)
推荐(0)
摘要:
re模块 常用正则表达式符号 '.' 默认匹配除\n之外的任意一个字符,若指定flag DOTALL,则匹配任意字符,包括换行 '^' 匹配字符开头,若指定flags MULTILINE,这种也可以匹配上(r"^a","\nabc\neee",flags=re.MULTILINE) '$' 匹配字 阅读全文
posted @ 2019-04-18 23:40
潇潇六月雨
阅读(85)
评论(0)
推荐(0)
浙公网安备 33010602011771号