seed random numbers
This commit is contained in:
2
main.py
2
main.py
@@ -4,6 +4,7 @@ import inky_helper as ih
|
|||||||
import inky_frame
|
import inky_frame
|
||||||
import gc
|
import gc
|
||||||
import random
|
import random
|
||||||
|
import time
|
||||||
|
|
||||||
def write_err(text):
|
def write_err(text):
|
||||||
with open('/sd/errors.log', 'a+') as error_log:
|
with open('/sd/errors.log', 'a+') as error_log:
|
||||||
@@ -54,6 +55,7 @@ if response != None:
|
|||||||
for item in response:
|
for item in response:
|
||||||
if item.url_path == last_file:
|
if item.url_path == last_file:
|
||||||
response.remove(item)
|
response.remove(item)
|
||||||
|
random.seed(time.time())
|
||||||
ran = random.choice(response)
|
ran = random.choice(response)
|
||||||
if ran.mimetype == "image/jpeg":
|
if ran.mimetype == "image/jpeg":
|
||||||
with open('/sd/last_wallpaper', 'w+') as update_last:
|
with open('/sd/last_wallpaper', 'w+') as update_last:
|
||||||
|
|||||||
Reference in New Issue
Block a user