![](https://img-blog.csdnimg.cn/20191016224400822.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python
Python相关,包括语法层面,底层原理,技术层面。
赵延超
敢于知道,因为真理使我们自由!
展开
-
EasyGUI实现简单的登录页面
EasyGUI实现简单的登录页面原创 2022-07-07 21:43:45 · 555 阅读 · 1 评论 -
turtle画一个狮子
turtle画狮子原创 2022-06-11 08:59:30 · 463 阅读 · 0 评论 -
MacOS下PyAutoGUI 只截背景
问题原因:MAC录屏权限问题解决措施:再尝试下代码看看原创 2022-05-27 10:19:56 · 372 阅读 · 0 评论 -
python的Counter测试频数
from collections import Counterif __name__ == "__main__": # 测试频数 data = [2, 2, 2, 2, 1, 1, 1, 3, 3] counter = Counter(data) print(counter.most_common()[0][1])原创 2022-03-07 12:12:25 · 344 阅读 · 0 评论 -
destroyAllWindows不管用
问题描述openCV中 destroyAllWindows 失效解决方案在destroyAllWindows函数后加四个:cv2.waitKey(1)cv2.waitKey(1)cv2.waitKey(1)cv2.waitKey(1)原创 2021-09-05 23:28:26 · 752 阅读 · 1 评论 -
PyCharm – TERM environment variable not set
问题描述import osos.system('clear')出现:TERM environment variable not set解决方案Open “Run/Debug configuration” and add an environment variable “TERM=xterm-color”原创 2021-06-30 13:24:23 · 2020 阅读 · 2 评论 -
python分系统操作
查看当前操作系统import sysprint(sys.platform)分系统操作import os # clearimport platformif platform.system().lower() == 'windows': os.system('cls') elif platform.system().lower() == 'linux': os.system('clear')elif platform.system().lower() == 'darwin': o原创 2021-06-30 13:11:59 · 201 阅读 · 0 评论 -
TypeError: ‘module‘ object is not callable
问题原因这个错误的意思是将模块作为一个函数来调用,但他本身却无法被调用。问题出现的原因在于import机制。Python导入模块的方法有两种:import module 和 from module import,区别是前者所有导入的东西使用时需加上模块名的限定,而后者不要。解决措施将import 后的内容加上包限制打个比方我现在有一个文件Group内容如下class Group: def __init__(self): # 构造函数 self.students原创 2021-06-30 11:36:34 · 4633 阅读 · 0 评论 -
Python-GUI实现图形窗口居中
核心代码def windowCenter(self,width,height): screenwidth = self.window.winfo_screenwidth() screenheight = self.window.winfo_screenheight() size = "%dx%d+%d+%d"%(width,height,screenwidth/2-width/2,screenheight/2-height/2) self.window.geometry(s原创 2021-06-27 20:56:09 · 1463 阅读 · 0 评论 -
pip出现版本过高
出现错误Traceback (most recent call last):File “/usr/bin/pip”, line 9, inload_entry_point(‘pip==21.0.1’, ‘console_scripts’, ‘pip’)()File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 378, in load_entry_pointreturn get_distribution(dist).loa原创 2021-06-27 19:35:24 · 1378 阅读 · 0 评论 -
Python-GUI编程测试
import tkinter as tkclass MainWindow(): def __init__(self): pass # 创建主窗口 self.window = tk.Tk() self.window.minsize(300, 300) self.window.title("示例") # 添加组件 self.addComponents() # 进入消息循环 self.window.mainloop() d原创 2021-06-20 15:56:55 · 238 阅读 · 0 评论 -
网络和邮件库:定时收发邮件(Python)
函数库poplib 支持 IMAP 协议imaplib 支持 POP3 协议MAP 协议在支持双向操作的功能上更加强大,并且能把客户端对邮件的删除等操作同步到服务端,也能把服务端对邮件删除的操作同步到客户端。与 POP3 协议只能把服务端的操作单向同步给客户端相比,会更加灵活。操作步骤指定邮件服务器的 IMAP 地址和端口 :大部分对邮件安全比较重视的公司,为了防止黑客暴力发现邮件服务器用户的弱口令密码,默认是将 IMAP 服务的功能关闭的。你需要联系邮件服务器管理员或通过网页管理功原创 2021-06-05 22:32:45 · 327 阅读 · 0 评论 -
Python贪吃蛇
import randomimport pygameimport sysfrom pygame.locals import * Snakespeed = 17Window_Width = 800Window_Height = 500Cell_Size = 20 # Width and height of the cells# Ensuring that the cells fit perfectly in the window. eg if cell size was# 10转载 2021-05-20 12:14:48 · 154 阅读 · 0 评论 -
统计学相关
代码地址:传输门相关细节待更新原创 2020-05-02 10:50:26 · 217 阅读 · 0 评论 -
Python习题集
T19.要求及代码演示:# encoding='gbk'import struct# 19.整数和汉字的关系.# 19.1定义两个整数a=3604003322, b=3303258819, 打印出它们的hex码;# 换了个牛点的数字a = 3604003322b = 3303258819print(hex(a))print(hex(b))# 19.2把a, b两个整数...原创 2019-10-28 11:39:50 · 945 阅读 · 0 评论 -
Python简单实现套接字过程
参考模型:详细步骤:服务端:①创建套接字② 绑定③监听④处理信息客户端①创建套接字② 链接套接字代码实现Pycharm中可能遇到问题:SyntaxError: Non-UTF-8 code starting with ‘\xc1’解决方案:https://blog.csdn.net/wyb_hardworking/article/details/195629...原创 2019-10-27 11:37:27 · 667 阅读 · 0 评论 -
Pyhton调用C++程序
编写C++程序#include <iostream>using namespace std;void Test(int x) { cout << "我是" << x << ",就这么任性!" << endl;}extern "C" {void test(int x) { Test(x);}}解...原创 2019-10-08 09:47:05 · 193 阅读 · 0 评论