摘要:
import time import random # python 列表 和元组通过千万级别的数据访问,对比耗时时间,元组访问速度不一定比列表快,还是列表略快过元组。 def ListTime(): print('正在计算访问列表元素耗时时间') l = [i for i in range(100 阅读全文
摘要:
不依赖第三方库编写进度条 # 不依赖第三方库,进度条设计 X = 10000 for i in range(X): for j in range(X): k = j * i # 80 是进度条的在显示时的比例,按需分配;'\r':每次输出让光标都回到首行 print('进度', f'|{"█"*(( 阅读全文
摘要:
#!/bin/bash cat > my_python_script.py <<EOF #!/usr/bin/env python3 print("Hello, World!") print('This is a Python script with both "double" and \'sing 阅读全文