有没有人知道用python更改Windows桌面墙纸的方法,以便更改是永久性的?我找到了这段代码
import ctypes
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, "myimage.jpg" , 0)
Run Code Online (Sandbox Code Playgroud)
此代码有效,但一旦您注销并再次登录,背景将返回到原始图像.我更喜欢一个不需要任何注册表编辑的解决方案,我想要一些适用于Windows XP和7的东西,如果可能的话.
有人可以解释类型转换如何在行中运行int y =(int)x; 谢谢
public class typecast
{
public static void main(String [] args)
{
double x=10.5;
int y=(int) x;
System.out.println("x="+x);
System.out.println("y="+y);
}
}
Run Code Online (Sandbox Code Playgroud)