As you can see, I followed the approach proposed by @meskr from How can I change my desktop background with python? to write my script in order to change my wallpaper.
ctypes.windll.user32.SystemParametersInfoW(20, 0, filepath, 0)
My system is Windows 10, and I use python 3.5. The code works fine, It can help me change my wallpaper correctly. But the wallpaper will reset to the default one when I reboot my system. I don't know why and how to avoid this.