hi all,
I would like write a python code to set dynamically the desktop of my laptop as different internet web pages. it is possible?
many thanks in advance
It should be possible, but it will depend on tools that are specific to the operating system.
I would start with a search like this one. There are two basic approaches for the problem of actually setting the wallpaper: you can look for something in the Windows API (and then use a third-party library such as pywin32 to make it possible to make Windows API calls from Python. Or you can look for a DOS command that sets the wallpaper, and use the standard library subprocess
to run that program.
For the rest of the project you will need a clearer specification before it’s possible to write the code. For example, I can’t understand what you mean by having a “internet web page” as a desktop. I assume you are talking about desktop wallpaper (what you see behind the icons on your desktop); that’s just a plain image, not a web site. If you want to download images to use from somewhere, then first you’ll need rules that tell you where to get them from, when to do it, how to choose an image etc. If you have something else in mind, then you need to explain it more clearly.
This has several moving parts:
- what web pages to view? you could just start with an explicit list of
URLs - fetch and render the page; the easy route might be selenium, which
lets you test web browsers - set the wallpaper; this is platform specific and varies between
Windows, MacOS, X11 and Wayland desktops
The most complex part is using selenium. The package itself is described
here:
and sample code to make a screenshot is here:
Ah, it hadn’t even occurred to me that the goal would be to set the desktop wallpaper to an image of the rendered webpage (Maybe this is for a prank rather than a personal utility?)
I’m a bit literal minded; this may not be what the OP meant. - Cameron
in details i created a dashboard with node-red and I can reach it using the web page http://myip:1880
I would like show that page as desktop wallpaper. for example for windows exists the package “lively” but for my purpose I need do it with a python script
many thanks to everybody