随笔分类 - python
摘要:https://github.com/pyenv-win/pyenv-win 安装 git clone https://github.com/pyenv/pyenv.git ~/.pyenv 你的 ~/.bashrc配置修改 # pyenv 配置 export PYENV_ROOT="$HOME/.
阅读全文
摘要:有空学一下 占个位 https://www.bilibili.com/video/BV1J4411p7DY/?spm_id_from=333.337.search-card.all.click&vd_source=caabcbd2a759a67e2a3de8acbaaf08ea 安装 pip ins
阅读全文
摘要:pip3 install Appium-Python-Client -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
阅读全文
摘要:列表,元组(不可添加和修改),字典 3种集合模式 模块 类 函数 要把文件变成双击运行,要把文件的属性选择python安装目录下的python.exe 1、查看数据类型 print(type(hour)) 2、转换数据类型: 整数字符串转换为对应的整数int('12') 数字转换为字符串str(12
阅读全文
摘要:import redis # # redis 取出的结果默认是字节,我们可以设定 decode_responses=True 改成字符串。 # r = redis.StrictRedis(host='localhost', port=6379, db=0,decode_responses=True)
阅读全文
摘要:信息: asdasd[[exodus]{aa:1}] # 方法一:# print(# re.findall("consumer (.*)lucax",aa) # ) https://www.cnblogs.com/kaibindirver/p/7488885.html # 方法二: print(aa
阅读全文
摘要:https://mp.weixin.qq.com/s/Jnd1HIeU_-lF0lJCESGRCQ PyInstaller库 http://c.biancheng.net/view/2690.html 打包后无需python环境
阅读全文
摘要:https://pypi.org/project/PyAutoGUI/ https://blog.csdn.net/qq_34053552/article/details/79776671 b站很多例子 安装库 https://pypi.org/project/PyAutoGUI/ pip3 in
阅读全文
摘要:# coding=utf-8 class SomeClass(object): def __init__(self): # 替换speck方法 self.speak= self.new_speak def speak(self): return "hello world" def new_speak
阅读全文
摘要:python2 中文乱码解决方法: https://www.cnblogs.com/phyger/p/9561283.html 使用pandas import pandas a = { "姓名":['张三'], "年龄":[23] } data = pandas.DataFrame(a) # a需要
阅读全文
摘要:豆瓣 https://pypi.douban.com/simple 阿里云 https://mirrors.aliyun.com/pypi/simple 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple 中国科技大学 https://pypi.mirrors
阅读全文
摘要:当我们使用函数时,需要传入不定个数的位置参数时,就可以使用*号表示,即*args,以元组形式传入;需要传入不定个数的关键字参数时,使用**表示,即**kwargs,以字典形式传入。 def func(*args,**kwargs): print(args) print(kwargs) func(1,
阅读全文
摘要:1、生成100个字符的数组 phoneNumber=[str(13812120000+i) for i in range(100)]
阅读全文
摘要:excel表写入如下: 1-张三-13岁-男 2-里斯-1岁-女 如果不用函数 那么要2个for循环 用函数就一个for i, item in enumerate(all_data): 即可 https://www.runoob.com/python/python-func-enumerate.ht
阅读全文
摘要:import oshandle=os.getpid()
阅读全文
摘要:class a(): def a1(self): print (123) def __test3(self): #私有函数,其他脚本文件是无法调用的,函数命名规则就是前面加 __(2个下划线) print ("私有函数")
阅读全文
摘要:在Python语言中,有些库在使用时,在网络上找到的文档不全,这就需要查看相应的Python对象是否包含需要的函数或常量。下面介绍一下,如何查看Python对象中包含哪些属性,如成员函数、变量等,其中这里的Python对象指的是类、模块、实例等包含元素比较多的对象。这里以OpenCV2的Python
阅读全文
摘要:后记: 上面用veal()函数 中文会乱码,再使用 print json.dumps(list, encoding="UTF-8", ensure_ascii=False) 就不会乱码了 乱码原因: 源码文件的编码格式为utf-8,但是window的本地默认编码是gbk,所以在控制台直接打印utf-
阅读全文
摘要:补充点: 1、获取线程的名字 2、给线程命名 主文章 https://www.cnblogs.com/kaibindirver/p/11432880.html 获取线程id threading.currentThread().ident
阅读全文