一、”序列”类型转str。函数:string.join()
需要注意的是该方法需要list中的元素为字符型,若是整型,则需要先转换为字符型后再转为str类型。
-
>>> n1 = (‘1’,‘2’,‘3’,‘a’,‘s’) # 字符类型可直接连接
-
>>> n2 = [4,5,6,7,8,9]
一、”序列”类型转str。函数:string.join()
需要注意的是该方法需要list中的元素为字符型,若是整型,则需要先转换为字符型后再转为str类型。
国内源:#
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
note:新版ubuntu要求使用https源,要注意。
例如:pip3 install -i https://pypi.doubanio.com/simple/ 包名
临时使用:#
可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。
永久修改,一劳永逸:#
Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)
内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
windows下,直接在user目录中创建一个pip目录,再新建文件pip.ini。(例如:C:\Users\WQP\pip\pip.ini)内容同上。
原文作者: …
可变数据类型:列表list、字典dict;
不可变数据类型:整型int、浮点型float、字符串型string和元组tuple。
可变数据类型:value值改变,id值不变;不可变数据类型:value值改变,id值也随之改变。
原文作者: BG6RSH | 查看原帖…
Python的组合数据类型:集合、序列、字典三种,序列又包括:元祖、列表类型。
原文作者: BG6RSH | 查看原帖…
在configuration.yaml中添加: api_password: !secret api_password
在secrets.yaml中添加:api_password: PASSWORD
原文作者: BG6RSH | 查看原帖…
Raspberry Pi 或Arudino刷机方法:
https://www.zigbee2mqtt.io/information/ … thods.html
专用编程器刷机方法:
https://www.zigbee2mqtt.io/getting_star … c2531.html
https://bbs.hassbian.com/thread-4448-1-1.html
原文作者: BG6RSH | 查看原帖…
在MySQL 8.04前,执行:SET PASSWORD=PASSWORD(‘[新密码]’);但是MySQL8.0.4开始,这样默认是不行的。因为之前,MySQL的密码认证插件是“mysql_native_password”,而现在使用的是“caching_sha2_password”。
现在可以使用以下的方法去修改root密码
原文作者: BG6RSH | 查看原帖…
在debug.xml或traccar.xml中添加: <entry key=’geocoder.format’>%f</entry>
显示内容参数见下面说明:
/**
* Available parameters:
*
* %p – postcode
* %c – country
* %s – state
* %d – district
* %t – settlement (town)
* %u – suburb
* %r – street (road)
* …