随笔分类 -  python

摘要:import requests import bs4 from selenium.webdriver.common.by import By import pandas as pd driverPath = "C:\Program Files (x86)\Microsoft\Edge\Applica 阅读全文
posted @ 2024-03-20 19:48 子过杨梅 阅读(24) 评论(0) 推荐(0)
摘要:1.输入python manage.py makemigrations (你的app名称) --empty migrations自动创建成功 2.输入python manage.py makemigration python manage.py migrate 阅读全文
posted @ 2023-12-21 23:15 子过杨梅 阅读(130) 评论(1) 推荐(0)
摘要:一.环境 环境建议使用python3.8以上 二.包准备 1.找到你相应的python环境进入scrpit pip install django 2.打开你的工作目录,进入该文件夹相应的cmd,创建项目 “你刚刚下载的python的script环境”+django-admin.exe startpr 阅读全文
posted @ 2023-12-17 12:59 子过杨梅 阅读(13) 评论(0) 推荐(0)
摘要:def extract_number(filename): # 提取文件名中的数字部分 return int(''.join(filter(str.isdigit, filename))) target_list = sorted(os.listdir(path),key=extract_numbe 阅读全文
posted @ 2023-11-28 20:16 子过杨梅 阅读(209) 评论(0) 推荐(0)
摘要:import sys import msvcrt import threading import time import map import os import player global go_to,fresh_time go_to="s" fresh_time=0.1 def stop(x,y 阅读全文
posted @ 2023-08-09 11:34 子过杨梅 阅读(38) 评论(0) 推荐(0)
摘要:def get_GD(location): url='https://restapi.amap.com/v3/assistant/coordinate/convert?' key='208ce530fdd2dc162c8831657fff3232' link='{}locations={}&coor 阅读全文
posted @ 2023-07-30 17:32 子过杨梅 阅读(189) 评论(0) 推荐(0)
摘要:def get_dis_tm(origin, destination): url = 'https://restapi.amap.com/v3/direction/driving?' key = '208ce530fdd2dc162c8831657fff3232' #这里就是需要去高德开放平台去申请 阅读全文
posted @ 2023-07-26 19:49 子过杨梅 阅读(98) 评论(0) 推荐(0)
摘要:import requests import bs4 import Mysql import time import pymysql db = pymysql.connect(host="localhost",port=3306,user='root',password='Njx200259',db 阅读全文
posted @ 2023-07-21 12:37 子过杨梅 阅读(65) 评论(0) 推荐(0)
摘要:import requests import bs4 url="https://ditu.amap.com/service/regeo?longitude=114.538985&latitude=38.047186" params = { "longitude": "114.538985", "la 阅读全文
posted @ 2023-07-19 23:50 子过杨梅 阅读(55) 评论(0) 推荐(0)
摘要:import requests import re import bs4 import pandas as pd import csv a = [] url = "http://www.tianqihoubao.com/lishi/shijiazhuang/month/202004.html" r 阅读全文
posted @ 2023-07-19 23:49 子过杨梅 阅读(38) 评论(0) 推荐(0)
摘要:class UrlManager(): #url管理器 def __init__():#设置新老url数组,分别为未爬取和已爬取 self.new_urls = set() self.old_urls = set() def add_new_url(self,url):#添加单个url if url 阅读全文
posted @ 2023-07-17 14:33 子过杨梅 阅读(47) 评论(0) 推荐(0)