技巧:先获取文件的绝对路径,再获取文件所在的目录。试了很多方法都不好使,就这个好使。import os path = os.path.dirname(os.path.abspath(__file__))+'/' print(path)验证如下:
最近接到一个需求,需要获取高德地图上的门店信息,查了一下官方有api接口(默认是1000的免费请求额度),300块钱买10万额度。记录一下实现方法(全是chatgpt帮我写的),后续如果有市场调研可能可以用上。主代码:get_types.pyimport requests import json import datetime import pymysql def getData(apik...
最近发现之前用的一些国内源更新和速度都很慢,改一个好用的源,北外的:pip install -i https://mirrors.bfsu.edu.cn/pypi/web/simple pip -U pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple