摘要: # 1. 设置root账户 设置密码 sudo passwd root # 2. ssh远程登陆拒绝访问:修改SSH配置文件 sudo vim /etc/ssh/sshd_config # 允许远程登录 PermitRootLogin yes # 3. 重启服务 sudo service ssh r 阅读全文
posted @ 2020-11-10 00:18 疯狂列表推导式 阅读(398) 评论(0) 推荐(0) 编辑
摘要: #!/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 阅读全文
posted @ 2020-11-09 08:11 疯狂列表推导式 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 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 # 阅读全文
posted @ 2020-11-04 13:06 疯狂列表推导式 阅读(71) 评论(0) 推荐(0) 编辑
摘要: import paramiko def connect_to_server(): client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) print(' 开始连接服务器 ') 阅读全文
posted @ 2020-11-03 23:17 疯狂列表推导式 阅读(71) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt x_data = ['2011', '2012', '2013', '2014', '2015', '2016', '2017'] y_data = [58000, 60200, 63000, 71000, 84000, 90500, 阅读全文
posted @ 2020-11-03 23:03 疯狂列表推导式 阅读(100) 评论(0) 推荐(0) 编辑
摘要: from PIL import Image import pytesseract image = Image.open('demo.png') content = pytesseract.image_to_string(image, lang='chi_sim') print('demo图片中的文字 阅读全文
posted @ 2020-11-03 22:13 疯狂列表推导式 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-11-03 22:04 疯狂列表推导式 阅读(528) 评论(0) 推荐(0) 编辑
摘要: all_dat_str = '1213124123425' # 写入信息 with open('音频信息1111111111111', 'w') as f: print('写入信息的长度为 ', f.write(all_dat_str)) # 确认有信息 with open('音频信息1111111 阅读全文
posted @ 2020-11-03 08:06 疯狂列表推导式 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-11-03 07:52 疯狂列表推导式 阅读(426) 评论(0) 推荐(0) 编辑
摘要: # 加u说明编码的方式 data_str = u'中文测试' print('加u,说明是unicode编码的变量 ', len(data_str)) 加u,说明是unicode编码的变量 4 # 禁止\的转义功能 r_str = r'\n' o_str = '\\n' print('加r,去掉反斜杠 阅读全文
posted @ 2020-11-02 23:51 疯狂列表推导式 阅读(182) 评论(0) 推荐(0) 编辑