![](https://img-blog.csdnimg.cn/20210628101716417.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
python
python学习
烧一壶开水
这个作者很懒,什么都没留下…
展开
-
Ubuntu 22.04 随便一玩
Ubuntu原创 2022-08-14 17:31:12 · 246 阅读 · 2 评论 -
Ubuntu下创建Python虚拟环境和包
Ubuntu下创建Python虚拟环境和包虚拟环境包虚拟环境mkdir .venvcd .venvpython3 -m venv tutorial-envsource tutorial-env/bin/activatepython>>> import sys>>> sys.path包# 安装包python -m pip install django# 指定版本安装python -m pip install requests==2.6.0# 将原创 2022-03-09 13:50:25 · 1026 阅读 · 0 评论 -
tidevice-【iOS安装工具包】
# 安装pip3 install -U "tidevice[openssl]" # 配对tidevice.exe pair# 查看连接设备tidevice.exe list# 安装应用tidevice.exe install example.ipa# 指定设备安装tidevice.exe -u 设备名 install *.ipa# 卸载应用tidevice uninstall *.ipa# 启动应用tidevice launch *.ipa# 停止应用tidevi原创 2022-03-02 14:52:50 · 642 阅读 · 0 评论 -
for-语句
for列表字典集合字符串元组for 语句支持 列表、字典、集合、字符串、元组列表li = [1, 2, 3, 'a', 'b', 'c']for i in li: print(i)字典d = {'a': 1, 'b': 2, 'c': 3}# print(d[1:2])for i in d: print(i)集合s = {'a', 'b', 'c', 1, 2, 3}for i in s: print(i)字符串sa = '1,a'for i原创 2021-12-09 13:45:28 · 83 阅读 · 0 评论 -
Python-索引和切片
下标索引和切片下标索引切片下标索引# 索引支持 字符串、列表、元组s = '1,a'print(s[1])t = 1, 2, 'a'print(t[1])li = [1, 2, 3, 'a', 'b', 'c']print(li[-1]),2c切片# 字符串、列表、元组s = '1,a'print(s[1::])t = 1, 2, 'a'print(t[1::])li = [1, 2, 3, 'a', 'b', 'c']print(li[-6::])原创 2021-12-09 13:26:21 · 215 阅读 · 0 评论 -
Python-推导式
推导式列表推导式字典推导式集合推导式元组推导式列表推导式squares = [x**2 for x in range(10)]print(squares)[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]字典推导式d = {x: x**2 for x in (2, 4, 6)}print(d){2: 4, 4: 16, 6: 36}集合推导式s = {x for x in 'abracadabra' if x not in 'abc'}print(s)原创 2021-12-09 10:29:11 · 295 阅读 · 0 评论 -
python-数据结构-Set
Set1.`len(s)`1.len(s)2.x in s3.x not in s4.isdisjoint(other)原创 2021-12-08 08:54:04 · 712 阅读 · 0 评论 -
python-数据结构-Dict
DICT1.`list(d)`2.`len(d)`3.`d[key]`4.`d[key] = value`5.`del d[key]`6.`key in d`7.`key not in d`8.`iter(d)`9.`clear()`10.`copy()`11.`classmethod fromkeys(iterable[, value])`12.`get(key[, default])`13.`items()`14.`keys()`15.`pop(key[, default])`16.`popitem()原创 2021-12-03 14:23:59 · 1041 阅读 · 0 评论 -
python-字符串方法
字符串方法==1.== `str.capitalize`()2. `str.casefold`()3. `str.center(whidth[,fillchar])`4. `str.count(sub[,start[,end]])`5. `str.encode(encoding='utf-8',errors='strict')`6. `str.endswith(suffix[,start[,end]])`7. `str.expandtabs(tabsize=8)`8. `str.find(sub[,str原创 2021-11-29 11:22:23 · 187 阅读 · 0 评论 -
python-数据结构-List
list的操作方法list.append(x)list.extend(iterable)list.insert(i, x)list.remove(x)list.pop([i])list.clear()list.index(x[, start[, end]])list.count(x)list.sort(*, key=None, reverse=False)list.reverse()list.copy()list.append(x)# 在列表的末尾添加一个元素。相当于 a[len(a):] = [x]原创 2021-11-29 09:00:46 · 565 阅读 · 0 评论 -
python-内置函数
内置函数A1.`abs()`2.`aiter()`3.`all()`4.`any()`5.`anext()`6.`ascii()`B7.`bin()`8.`bool()`9.`breakpoint()`10.`bytearray()`11.`bytes()`C12.`callable()`13.`chr()`14.`classmethod()`15.`compile()`16.`complex()`D17.`delattr()`18.`dict()`18.`dir()`19.`divmod()`E20.`e原创 2021-12-03 13:57:31 · 248 阅读 · 0 评论