随笔分类 - python
摘要:先上效果,视频敬上: 字符舞: 代码舞 源代码: video_2_code_video.py 1 import argparse 2 import os 3 import cv2 4 import subprocess 5 from cv2 import VideoWriter_fourcc 6 f
阅读全文
摘要:先在 pycharm 安装 myqr。或者,Python3 必装,然后命令行 pip install myqr 也可。 将我的微信公众号网址:http://weixin.qq.com/r/hRMQCB7EL0NQrVpr90aX 生成二维码 myqr http://weixin.qq.com/r/h
阅读全文
摘要:作家王小波其实也是我国最早期的程序员,突发奇想,王小波写情书最喜欢用哪些词呢?用Python词云分析下! 直接上代码吧,有注释很好理解。输出的图片设置的比较大,所以运行的比较慢,可以适当把图片尺寸改小点。 1 import jieba 2 from stylecloud import gen_sty
阅读全文
摘要:就这一句: import this 输出: The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex.
阅读全文
摘要:1、C语言演奏生日快乐歌 效果:https://www.bilibili.com/video/BV16h411Q7qG 视频无法上传,请移步B站欣赏。 C语言演奏生日快乐歌 1 #include <windows.h> 2 3 void Birthday(); 4 5 int main() 6 {
阅读全文
摘要:在Python Console输入以下代码: while(True): 问话=input("真人:"); print("假机器人:"+问话.strip("吗??")+"!");while(True): 问话=input("真人:"); print("假机器人:"+问话.strip("吗??")+"!
阅读全文
摘要:源码: 1 from PyQt5.QtWidgets import QApplication 2 import win32gui 3 import sys 4 import time 5 record = win32gui.FindWindow(None, 'C:\Windows\system32\
阅读全文
摘要:IO操作的类型 文件读写是最常见的IO操作。Python内置了读写文件的函数,用法和C是兼容的。 在磁盘上读写文件的功能都是由操作系统提供的,现代操作系统不允许普通的程序直接操作磁盘。 读写文件就是请求操作系统打开一个文件对象(通常称为文件描述符),然后,通过操作系统提供的接口从这个文件对象中读取数
阅读全文
摘要:" # $ & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ [ ] _ } · × Δ Ψ γ μ φ В — ‘ ’ “ ” ℃ Ⅲ ↑ → ≈ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ■ ▲ 、 。 〉 《 》 」 『 』 【 】 〔
阅读全文
摘要:源码: 1 import random 2 rang1 = int(input("请设置本局游戏的最小值:")) 3 rang2 = int(input("请设置本局游戏的最大值:")) 4 num = random.randint(rang1,rang2) 5 guess = "guess" 6
阅读全文
摘要:游戏中: 跳一跳 源码及文件在文末,需要自取。 源码: 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 4 import os 5 import sys 6 import re 7 import json 8 import time 9 imp
阅读全文
摘要:源码: 1 from PIL import Image 2 import xlsxwriter 3 4 # 颜色转换函数 5 def color(value): 6 digit = list(map(str, range(10))) + list("ABCDEF") 7 if isinstance(
阅读全文
摘要:准备工作: 心形曲线的计算公式:(x^2+y^2-1)^3+x^2*y^3=0 依赖库:numpy 和 matplotlib pip3 install numpy pip3 install matplotlib No module named ‘matplotlib‘ 解决办法 No module
阅读全文
摘要:源码(注释很详细): 1 # -*- coding=utf-8 -*- 2 ############################################################ 3 #1:import argparse 4 5 #2:parser = argparse.Argum
阅读全文
摘要:像素画: 需要用到的包: 进度条:progressbar pip install progressbar -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com excel:操作包openpyxl pip
阅读全文
摘要:准备:pip install win32gui 可能遇到的麻烦: No module named ‘win32gui‘ 的解决方法(踩坑之旅) 源码: 1 import win32gui 2 import win32con 3 import win32clipboard as w 4 import
阅读全文
摘要:1、抖音同款,不同意不许走 源码:love.py 1 # coding: utf8 2 from tkinter import * 3 from tkinter import messagebox 4 import random 5 6 def no_close(): 7 return 8 9 #关
阅读全文
摘要:源码: 1 # -*- coding: UTF-8 -*- 2 3 import os, re 4 import random 5 6 xx = "学生会退会" 7 8 text = [ 9 "现在, 解决x的问题, 是非常非常重要的. 所以, ", 10 "我们不得不面对一个非常尴尬的事实, 那就
阅读全文
摘要:0、写在前面 Python之文章生成器(升级版,也就是更傻瓜式运行) 借用狗屁不通生成器主要代码,修改引用数据,然后就是这个打拳生成器了!很多教程都会缺少关键文件,按着我的教程一步步走,一定可以运行。 1、主体代码 nonsense.py 1 import random,dataread 2 3 d
阅读全文
摘要:Python之文章生成器 Python之文章生成器(升级版,也就是更傻瓜式运行) 狗屁不通文章生成器 Python之手把手教你自动获取青年大学习完成图片,并生成朋友圈截图 1、小学生计算题自动生成器 源码: 1 import random, os 2 import PySimpleGUI as sg
阅读全文

浙公网安备 33010602011771号