
python
yellow_flowers
这个作者很懒,什么都没留下…
展开
-
idea java调用python代码
1.通过本地python环境直接运行 public static void demo01() throws Exception{ System.out.println("java ___________________________"); Process process = Runtime.getRuntime().exec("py E:\\java_project\\database01\\src\\main\\java\\test.py"); B原创 2022-01-24 15:23:25 · 2452 阅读 · 0 评论 -
python爬取小说红楼梦
import requests from bs4 import BeautifulSoup import lxml def getsg(): headrs = { 'User - Agent': 'Mozilla / 5.0(Windows NT 10.0;Win64;x64) AppleWebKit / 537.36(KHTML, likeGecko) Chrome / 95.0.4638.69Safari / 537.36Edg / 95.0.1020.53' } .原创 2021-11-21 01:03:32 · 1575 阅读 · 0 评论 -
python uuid md5加密
import hashlib # 加密 手机号后六位 SALT = 'SAFDSAFADS,(#336,.!F332' def generate_pwd(str1): obj = hashlib.md5(SALT.encode('utf-8')) obj.update(str1.encode('utf-8')) return obj.hexdigest() if __name__ == '__main__': print(generate_pwd("232147")) .原创 2021-11-06 16:27:53 · 479 阅读 · 0 评论 -
python获取行政区域代码
import requests import time from lxml import etree import json # headers = { # 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.204 Safari/537.36', # 'Cookie':'AD_RS_COOKIE=20080918; _trs.原创 2021-11-06 16:25:50 · 503 阅读 · 0 评论 -
python实现excel表格读写操作
import xlrd import re def filetest1(): with open('file/akko') as file_object: # with open('D:test/test.txt') as file_object: # 绝对路径 # print(type(file_object.read().rstrip())) #read到文件末尾时会返回一个空字符串 这个空字符串打印出来显示空行 obj1 = .原创 2021-10-31 21:54:47 · 200 阅读 · 0 评论