随笔分类 - python
python学习
摘要:python import os os.chdir(r"D:\statashu1\0628\盈利能力144601848") import pandas as pd df=pd.read_excel("FI_T5.xlsx") print(df.head()) df[df.columns.tolist
阅读全文
摘要:md5()方法使用 若要对中文进行加密,需要进行字符转码: import hashlib def myMd5(): data = "你好吗" md5Data = hashlib.md5(data.encode(encoding='utf-8')).hexdigest() # print(md5Dat
阅读全文
摘要:# coding:utf-8 import base64 import requests url="https://amdc.m.taobao.com/amdc/mobileDispatch" headers={"Accept": "*/*", "Content-Type": "applicatio
阅读全文
摘要:def get_sign(Pm): #这里是加密需要的字段 arg0 = Pm['appKey'] arg1 = Pm['utdid'] + "&" arg1 = arg1 + Pm['uid']+ "&" arg1 = arg1 + Pm['reqbiz-ext']+ "&" arg1 = arg
阅读全文
摘要:def request(flow: http.HTTPFlow) -> None: # pretty_url takes the "Host" header of the request into account, which # is useful in transparent mode wher
阅读全文
摘要:# coding:utf-8 import base64 import requests url="https://amdc.m.taobao.com/amdc/mobileDispatch" headers={"Accept": "*/*", "Content-Type": "applicatio
阅读全文
摘要:import binascii import sys import os.path SV = [0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x6980
阅读全文
摘要:pip install pagesnapplaywright install python310以上 命令:pagesnap 网址 网络名称 提示: 请求成功 response.url='https://www.cnpython.com/pypi/singlefile'请求成功 response.u
阅读全文
摘要:import re,sys,time,sys,os,json #abc='' ax=0 abc=abc.replace('\n','').replace('\r\n','') abd=abd.replace('\n','').replace('\r\n','') abe=abe.replace('\
阅读全文
摘要:from PIL import Image, ImageTk import requests import tkinter # 导入Tkinter模块 #import tk paa = 'aaa.gif' url = 'http://www.baidu.com/img/baidu_jgylogo3.
阅读全文
摘要:from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By #按照什么方式查找,By.ID,By.CSS_SELECTOR
阅读全文
摘要:import re,sys,time,os,requests from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdr
阅读全文
摘要:1、引入 from selenium import webdriver from selenium.webdriver import ActionChains # 滑动验证码 from selenium.webdriver.common.by import By #按照什么方式查找,By.ID,By
阅读全文
摘要:Python中可以使用pyodbc模块连接Microsoft Access数据库(.mdb格式)。 首先需要先安装pyodbc模块和Microsoft Access驱动程序,可以使用pip安装pyodbc: ``` pip install pyodbc ``` 然后需要下载安装Microsoft A
阅读全文
摘要:Python 中,可以使用标准库 sqlite3 来读写 SQLite 数据库。 下面是一个示例代码,展示如何连接到 SQLite 数据库,创建表格,插入数据,查询数据和关闭数据库: import sqlite3 # 连接到数据库 conn = sqlite3.connect('example.db
阅读全文
摘要:import sqlite3 # 连接到SQLite3数据库 conn = sqlite3.connect('example.db') # 创建一个表 conn.execute('''CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY A
阅读全文
摘要:import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage # 邮件发件人和收件人信
阅读全文
摘要:一个让你可以跟 GitHub 仓库进行对话的 Python 工具:Chat-with-GitHub-Repo。仓库包含两个 Python 脚本,演示如何使用 Streamlit、OpenAI GPT-3.5-turbo 和 Deep Lake 来创建 AI 聊天机器人。聊天机器人搜索存储在 Deep
阅读全文
摘要:def hi(name="yasoob"): return "hi " + name print(hi()) # output: 'hi yasoob' # 我们甚至可以将一个函数赋值给一个变量,比如 greet = hi # 我们这里没有在使用小括号,因为我们并不是在调用hi函数 # 而是在将它放
阅读全文
摘要:def hi(): return "hi yasoob!" def doSomethingBeforeHi(func): print("I am doing some boring work before executing hi()") print(func()) doSomethingBefor
阅读全文