更改桌面背景 [英] change desktop background

查看:139
本文介绍了更改桌面背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改桌面背景与Python

how can i change desktop background with python

我想这样做,在Windows和Linux

i want to do it in both windows and linux

感谢

推荐答案

在GNOME桌面,你平时做的gconf用,无论是直接调用gconftool或使用的gconf Python模块。后者是在由unutbu给出的链接。第一种方法可以这样做。

On a gnome desktop, you usually do this with gconf, either directly calling gconftool or using the gconf python module. The latter is in the link given by unutbu. The first method could be done like this.

import commands
command = "gconftool-2 --set /desktop/gnome/background/picture_filename --type string '/path/to/file.jpg'"
status, output = commands.getstatusoutput(command)  # status=0 if success

这篇关于更改桌面背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆