随笔分类 -  Python

language
摘要:ctrl+p 命令帮助 ctrl+n 文件资源管理器添加新标签(win11) MButton 中键盘按下文件资源管理器回退 win+o 关闭显示器 阅读全文
posted @ 2023-09-18 14:02 CGRun 阅读(176) 评论(0) 推荐(0)
摘要:# encoding:utf-8 import os def search(path): if os.listdir(path):#判断文件夹是否为空 print( os.listdir(path) )#打印文件夹内容 else: print('Sorry,这是一个空文件夹.') path = in 阅读全文
posted @ 2022-11-10 15:10 CGRun 阅读(1497) 评论(0) 推荐(0)
摘要:#导入OS模块 import os #待搜索的目录路径 path = "D:\dataset" #待搜索的名称 filename = "123" #定义保存结果的数组 result = [] def findfiles(path): # 首先遍历当前目录所有文件及文件夹 file_list = os 阅读全文
posted @ 2022-05-25 14:48 CGRun 阅读(3426) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- """ @Author: Meng @software: PyCharm @file: Python批量png转换jpg图片格式.py @time: 2021/10/30 20:02 """ import os from PIL import Imag 阅读全文
posted @ 2022-02-21 22:06 CGRun
摘要:# -*- coding: utf-8 -*- """ @Author: Meng @software: PyCharm @file: python获取计算机名IP用户名.py @time: 2021/10/28 20:44 """ import socket import getpass # 获取 阅读全文
posted @ 2022-02-21 21:59 CGRun 阅读(426) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- """ @Author: Meng @software: PyCharm @file: 批量删除文件或文件夹.py @time: 2021/10/28 20:06 """ import os import shutil # 导入模块 path = 'C 阅读全文
posted @ 2022-02-21 21:57 CGRun 阅读(1078) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- """ @Author: Meng @software: PyCharm @file: python提取音频.py @time: 2021/10/28 20:16 """ from moviepy.editor import * video = Vid 阅读全文
posted @ 2022-02-21 21:56 CGRun 阅读(100) 评论(0) 推荐(0)
摘要:python仅关闭显示器代码 # -*- coding: utf-8 -*- """ @Author: Meng @software: PyCharm @file: 关闭显示器.py @time: 2021/10/28 20:39 """ from ctypes import * HWND_BROA 阅读全文
posted @ 2022-02-21 21:45 CGRun