From 281b7b4f6decf6ccebfd6828be94735cacab5cd2 Mon Sep 17 00:00:00 2001 From: u214892 <u214892@sbb.ch> Date: Tue, 21 May 2019 10:10:34 +0200 Subject: [PATCH] cleanup flake8 --- examples/tkplay.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/tkplay.py b/examples/tkplay.py index b3372538..95842e3b 100644 --- a/examples/tkplay.py +++ b/examples/tkplay.py @@ -1,11 +1,12 @@ - +import time import tkinter as tk + from PIL import ImageTk, Image + from examples.play_model import Player -from flatland.envs.rail_env import RailEnv from flatland.envs.generators import complex_rail_generator +from flatland.envs.rail_env import RailEnv from flatland.utils.rendertools import RenderTool -import time def tkmain(n_trials=2): @@ -36,14 +37,14 @@ def tkmain(n_trials=2): for step in range(n_steps): oPlayer.step() env_renderer.renderEnv(show=True, frames=True, iEpisode=trials, iStep=step, - action_dict=oPlayer.action_dict) + action_dict=oPlayer.action_dict) img = env_renderer.getImage() img = Image.fromarray(img) tkimg = ImageTk.PhotoImage(img) if first: - panel = tk.Label(window, image = tkimg) - panel.pack(side = "bottom", fill = "both", expand = "yes") + panel = tk.Label(window, image=tkimg) + panel.pack(side="bottom", fill="both", expand="yes") else: # update the image in situ panel.configure(image=tkimg) @@ -56,4 +57,4 @@ def tkmain(n_trials=2): if __name__ == "__main__": - tkmain() \ No newline at end of file + tkmain() -- GitLab