编程哲学

Vibe Code 近期,一个名为 “Vibe Coding”(氛围编程)的概念迅速升温,引发了广泛讨论。它不仅仅是一个时髦术语,更可能预示着软件开发方式的一次深刻变革。 ...

创建: 2025-06-28 | 更新: 2025-06-28 | 字数: 29720字 | 时长: 60分钟 | RM

Python虚拟环境管理工具UV和JupyterNotebook联动

Python虚拟环境管理新利器——uv全解析 Python项目开发中,虚拟环境和依赖管理一直是让人头疼的话题。今天给大家介绍一个极致高速、功能强大的Python包和项目管理工具——uv,它由Rust语言编写,是由著名的Astral团队打造,同时也是性能爆棚的代码检查工具Ruff的作者开发。 ...

创建: 2025-05-23 | 更新: 2025-05-23 | 字数: 3570字 | 时长: 8分钟 | RM

使用Python把MP4文件批量转换为MP3文件

使用Python把MP4文件批量转换为MP3文件 前提:本地安装ffmpeg,可以选择安装pydub或是moviepy 使用Python调用ffmpeg需要安装ffmpeg-python 使用PyDub 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import os from pydub import AudioSegment def convert_mp4_to_mp3(directory): for filename in os.listdir(directory): if filename.endswith('.mp4'): mp4_file_path = os.path.join(directory, filename) mp3_file_path = os.path.splitext(mp4_file_path)[0] + '.mp3' try: # 使用 pydub 转换 mp4 为 mp3 audio = AudioSegment.from_file(mp4_file_path, format='mp4') audio.export(mp3_file_path, format='mp3') # 删除原有的 mp4 文件 os.remove(mp4_file_path) print(f"Converted {mp4_file_path} to {mp3_file_path} and deleted original mp4 file.") except Exception as e: print(f"Error processing {mp4_file_path}: {e}") # 设置你的目标目录 target_directory = r'E:\Entertainment\100s' convert_mp4_to_mp3(target_directory) 使用MoviePy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 import os from moviepy.editor import VideoFileClip def convert_mp4_to_mp3(directory): # 遍历目录 for filename in os.listdir(directory): if filename.endswith('.mp4'): mp4_file_path = os.path.join(directory, filename) mp3_file_path = os.path.splitext(mp4_file_path)[0] + '.mp3' try: # 使用 moviepy 转换视频为音频 video_clip = VideoFileClip(mp4_file_path) video_clip.audio.write_audiofile(mp3_file_path) video_clip.close() # 删除原有的 mp4 文件 os.remove(mp4_file_path) print(f"Converted {mp4_file_path} to {mp3_file_path} and deleted original mp4 file.") except Exception as e: print(f"Error processing {mp4_file_path}: {e}") # 设置你的目标目录 target_directory = r'E:\Entertainment\北流嘉措' convert_mp4_to_mp3(target_directory) 【最新】windows电脑FFmpeg安装教程手把手详解 windows电脑FFmpeg安装教程手把手详解教程来源 ...

创建: 2025-02-07 | 更新: 2025-02-07 | 字数: 5323字 | 时长: 11分钟 | RM

Jupyter Notebook本地配置

安装 在cmd中输入pip install -i https://pypi.douban.com/simple/ jupyter 如何更改Jupyter Notebook的默认工作路径? 1.在cmd中输入命令jupyter notebook --generate-config使Jupyter产生配置文件:Jupyter_notebook_config.py ...

创建: 2023-11-18 | 更新: 2023-11-18 | 字数: 2474字 | 时长: 5分钟 | RM

《用Python学数学》

前言 Math Adventures with Python: An Illustrated Guide to Exploring Math with Code by Peter Farrell 这里介绍用Python来解决数学问题深化自己的计算思维,帮我自己成为数据格致家。 读这本书主要是想实现元胞自动机,这个以前很想实现,但是一直拖延到了现在才行动,哎!本来打算暑假更完的,但没空更,先挖坑,以后再填。 ...

创建: 2023-09-02 | 更新: 2023-09-02 | 字数: 4722字 | 时长: 10分钟 | RM