随笔分类 -  python

摘要:import win32com.client scheduler = win32com.client.Dispatch('Schedule.Service') scheduler.Connect() folders = scheduler.GetFolder('\\') tasks = folder 阅读全文
posted @ 2022-12-06 11:26 CrossPython 阅读(49) 评论(0) 推荐(0)
摘要:import pywifi import time from pywifi import const # WiFi扫描模块 def wifi_scan(): # 初始化wifi wifi = pywifi.PyWiFi() # 使用第一个无线网卡 interface = wifi.interface 阅读全文
posted @ 2022-09-10 22:05 CrossPython 阅读(77) 评论(0) 推荐(0)
摘要:插播:python生成字典的方法 直接创建/键值对创建:dic={'a':1,'b':2,'c':3} dic=dict(a=1,b=2,c=3) 二元组列表创建:list=[('a',1),('b',2),('c',3)] dic=dict(list) 用dict和zip:dic=dict(zip 阅读全文
posted @ 2022-07-13 14:32 CrossPython 阅读(647) 评论(0) 推荐(0)
摘要:先从字符串到json a = json.loads(str) 处理完毕后再转json b = json.dumps(a).encode('utf8').decode('unicode-escape') 阅读全文
posted @ 2022-07-08 16:56 CrossPython 阅读(171) 评论(0) 推荐(0)
摘要:改源码 requestium.py if isinstance(self.webdriver_options['prefs'], dict): download_dir = self.webdriver_options['prefs'].get('download.default_directory 阅读全文
posted @ 2022-07-02 16:18 CrossPython 阅读(48) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- import requests bot = requests.session() bot.get('http://google.com') 保持 import requests, pickle session 阅读全文
posted @ 2022-06-18 20:13 CrossPython 阅读(325) 评论(0) 推荐(0)
摘要:from pyecharts.charts import Bar, Pie, Page, Grid, Line, Geo from pyecharts.faker import Faker from pyecharts import options as opts from pyecharts.gl 阅读全文
posted @ 2022-06-02 20:21 CrossPython 阅读(156) 评论(0) 推荐(0)
摘要:sender: django -> dataframe -> to_dict -> JsonResponse -> receiver: django -> result=post.json() -> df = pd.DataFrame(result) -> convert df2dict 阅读全文
posted @ 2022-05-19 09:09 CrossPython 阅读(203) 评论(0) 推荐(0)
摘要:https://pypi.tuna.tsinghua.edu.cn/simple/opencv-python/ 根据你python的版本,自己下载与python版本对应的opencv-python,网址如下 下载opencv-python 比如我的是python3.7,64位系统,就下载 openc 阅读全文
posted @ 2022-05-16 13:32 CrossPython 阅读(85) 评论(0) 推荐(0)
摘要:from django.shortcuts import HttpResponse import psutil from .models.first import func from multiprocessing import Process def index(request): n = 888 阅读全文
posted @ 2022-04-23 20:24 CrossPython 阅读(73) 评论(0) 推荐(0)
摘要:celery Redis Queue 只需使用一个线程。 import threading t = threading.Thread(target=long_process, args=args, kwargs=kwargs) t.setDaemon(True) t.start() return H 阅读全文
posted @ 2022-04-23 14:52 CrossPython 阅读(636) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-04-23 12:17 CrossPython 阅读(22) 评论(0) 推荐(0)
摘要:from subprocess import PIPE, STDOUT,Popen import traceback import subprocess # # -*- encoding=utf-8 -*- # from subprocess import Popen, PIPE, STDOUT # 阅读全文
posted @ 2022-04-22 23:19 CrossPython 阅读(34) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/jmilkfan-fanguiju/p/7533729.htmlWindows PowerShell 版权所有 (C) Microsoft Corporation。保留所有权利。 尝试新的跨平台 PowerShell https://aka.ms/ps 阅读全文
posted @ 2022-04-22 22:07 CrossPython 阅读(42) 评论(0) 推荐(0)
摘要:# https://msdn.microsoft.com/en-us/library/windows/desktop/aa383608(v=vs.85).aspx """ Windows Task Scheduler Module .. versionadded:: 2016.3.0 A modul 阅读全文
posted @ 2022-04-22 21:20 CrossPython 阅读(69) 评论(0) 推荐(0)
摘要:import sys import requests from requestium import Session, Keys import json import pandas as pd import time import pickle import os import datetime im 阅读全文
posted @ 2022-04-10 17:37 CrossPython 阅读(87) 评论(0) 推荐(0)
摘要:firstly, get cookie: browser.get_cookies()then transfer to requests session: cookies = login() for cookie in cookies: session.cookies.set(cookie['name 阅读全文
posted @ 2022-04-06 10:50 CrossPython 阅读(31) 评论(0) 推荐(0)
摘要:Exception 会捕获除了SystemExit 、KeyboardInterrupt 和GeneratorExit 之外的所有异常。 如果你还想捕获这三个异常,将 Exception 改成 BaseException 即可。 阅读全文
posted @ 2022-04-04 19:25 CrossPython 阅读(507) 评论(0) 推荐(0)
摘要:from selenium import webdriver from selenium.webdriver.common.by import By import time option = webdriver.ChromeOptions() option.add_experimental_opti 阅读全文
posted @ 2022-04-02 16:37 CrossPython 阅读(55) 评论(0) 推荐(0)
摘要:import requestsimport seleniumfrom selenium import webdriverfrom selenium.webdriver.common.by import By option = webdriver.ChromeOptions()option.add_e 阅读全文
posted @ 2022-04-01 17:05 CrossPython 阅读(467) 评论(0) 推荐(0)