巨蟒人类墙纸。
py-wallpaper的Python项目详细描述
壁纸
Get or set the desktop wallpaper
在MacOS 10.12+和Windows 10+上工作,灵感来自wallpaper node
安装
仅支持python3
pip install py-wallpaper
用法
fromwallpaperimportget_wallpaper,set_wallpaper# get current wallpaper's pathprint(get_wallpaper())# /Users/leetao/Workspace/py/wallpaper/tests/bg.jpg # your wallpaper path# set your photoset_wallpaper("your photo's path")
API
。获取壁纸(选项?)
返回当前桌面墙纸的路径。
选项
类型:object
屏幕{em1}$(仅限MacOS)
类型:string | number
值:'all'
,'main'
,或来自.screens()
的屏幕索引
默认值:'main'
从中获取墙纸的屏幕。
如果设置了'all'
,那么.get_wallpaper
将返回一个列表。
。设置墙纸(图像路径,选项?)
返回一个对象。
图像路径
类型:string
要设置为桌面墙纸的图像的路径。
选项
类型:object
屏幕{em1}$(仅限MacOS)
类型:string | number
值:'all'
,'main'
,或来自.screens()
的屏幕索引
默认值:'all'
打开壁纸的屏幕。
缩放{em1}$(仅限MacOS)
类型:string
值:'auto' | 'fill' | 'fit' | 'stretch' | 'center'
默认值:'auto'
缩放方法。
待办事项
Linux上的墙纸