随笔分类 - python
摘要:name = "jack" print(f"i'm {name}") print(F"i'm {name}") print("{1} and {0}".format("eggs", "spam")) print("this {food} is {adjective}".format(food="sp
阅读全文
摘要:os.listdir(path='.') Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order, and does not in
阅读全文
摘要:import datetime # 根据开始日期、结束日期返回这段时间里所有天的集合 def getDatesByDateInterval(start_day, end_day): result = [] date_start = datetime.datetime.strptime(start_d
阅读全文
摘要:在当前用户目录下的AppData\Roaming目录下新建pip目录,pip目录下新建pip.ini文件,pip.ini文件中内容如下: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] use-mirro
阅读全文
摘要:python版本:3.10.5 mysql版本: 8.0.27 oracle版本:oracle 12c 一、python连接mysql数据库 安装第三方依赖PyMySQL, 终端执行如下命令: pip install PyMySQL PyMySQL使用 import pymysql config =
阅读全文