python播放视频

python播放视频

1
pip install pygame

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pygame
 
pygame.init()
 
# Set the dimensions of the window
screen = pygame.display.set_mode((640, 480))
 
# Load the video file
video = pygame.movie.Movie("1.mp4")
 
# Play the video
video.play()
 
# Wait for the video to finish
while video.get_busy():
    pygame.time.Clock().tick(30)
 
# Quit the program
pygame.quit()

  

 

 

 

 

###############

posted @   西北逍遥  阅读(63)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
历史上的今天:
2022-04-10 给pcd添加头
2020-04-10 IfcRelDeclares
点击右上角即可分享
微信分享提示