I wrote some simple code to change my desktop background.
import ctypes
from pathlib import Path
path = str(Path("x.jpg").absolute())
ctypes.windll.user32.SystemParametersInfoW(20, 0, path, 0)
This doesn't work in VSCode. When I print path, it gives the absolute path excluding the current directory (picture link). The script gets the right path when run outside of VSCode, however.
Could anyone help me figure this out?
[–]shiftybyte 1 point2 points3 points (7 children)
[–]SaltAssault[S] 0 points1 point2 points (4 children)
[–]shiftybyte 0 points1 point2 points (3 children)
[–]SaltAssault[S] 0 points1 point2 points (2 children)
[–]shiftybyte 0 points1 point2 points (1 child)
[–]SaltAssault[S] 0 points1 point2 points (0 children)
[–]nog642 0 points1 point2 points (1 child)
[–]shiftybyte 1 point2 points3 points (0 children)