11 2020 档案
摘要:while True: paper_count = input("请输入要下载的5K超清壁纸的数量:") if paper_count.isnumeric() and int(paper_count) > 0: paper_count = int(paper_count) break
阅读全文
摘要:基本工具使用 windows电脑步骤: 1. 下载git.exe,安装 https://gitforwindows.org/ 2. 下载TortoiseGit,安装。(要首先步骤2, 不然会找不到git.exe) https://tortoisegit.org/download/ 3. 下载Tort
阅读全文
摘要:# 1. 设置root账户 设置密码 sudo passwd root # 2. ssh远程登陆拒绝访问:修改SSH配置文件 sudo vim /etc/ssh/sshd_config # 允许远程登录 PermitRootLogin yes # 3. 重启服务 sudo service ssh r
阅读全文
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- from tkinter import * import hashlib import time LOG_LINE_NUM = 0 class MY_GUI(): def __init__(self,init
阅读全文
摘要:from queue import Queue # 队列 先进先出 q = Queue() for i in range(5): q.put(i) while not q.empty(): print(q.get()) 0 1 2 3 4 from queue import LifoQueue #
阅读全文
摘要:import paramiko def connect_to_server(): client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) print(' 开始连接服务器 ')
阅读全文
摘要:import matplotlib.pyplot as plt x_data = ['2011', '2012', '2013', '2014', '2015', '2016', '2017'] y_data = [58000, 60200, 63000, 71000, 84000, 90500,
阅读全文
摘要:from PIL import Image import pytesseract image = Image.open('demo.png') content = pytesseract.image_to_string(image, lang='chi_sim') print('demo图片中的文字
阅读全文
摘要:import cv2 # 读取图片 img = cv2.imread('demo.png') # h、w为想要截取的图片大小 h, w = 35, 170 # 坐标 x, y= 500, 425 targetImg = img[(y):(y + h), (x):(x + w)] cv2.imwrit
阅读全文
摘要:all_dat_str = '1213124123425' # 写入信息 with open('音频信息1111111111111', 'w') as f: print('写入信息的长度为 ', f.write(all_dat_str)) # 确认有信息 with open('音频信息1111111
阅读全文
摘要:import redis def create_redis_pool(): REDIS_DB = '127.0.0.1' REDIS_PORT = 6379 pool = redis.ConnectionPool(host=REDIS_DB, port=REDIS_PORT, max_connect
阅读全文
摘要:# 加u说明编码的方式 data_str = u'中文测试' print('加u,说明是unicode编码的变量 ', len(data_str)) 加u,说明是unicode编码的变量 4 # 禁止\的转义功能 r_str = r'\n' o_str = '\\n' print('加r,去掉反斜杠
阅读全文