fixed depreciated

This commit is contained in:
paul-loedige
2023-01-10 09:43:51 +09:00
parent 7288e9d3cf
commit 810f81be66
+1 -1
View File
@@ -19,7 +19,7 @@ cmd = ['xrandr']
p = subprocess.Popen(cmd, stdout=subprocess.PIPE) p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
resolution_string, junk = p.communicate() resolution_string, junk = p.communicate()
p.stdout.close() p.stdout.close()
screen_resolutions = [np.array(screen_res.split('x')).astype(np.int) for screen_res in re.findall('[0-9]+x[0-9]+(?=[^\\\\n]*\*)',str(resolution_string))] screen_resolutions = [np.array(screen_res.split('x')).astype(int) for screen_res in re.findall('[0-9]+x[0-9]+(?=[^\\\\n]*\*)',str(resolution_string))]
number_of_screens = len(screen_resolutions) number_of_screens = len(screen_resolutions)
max_width = max(screen_resolutions, key=lambda res: res[0])[0] max_width = max(screen_resolutions, key=lambda res: res[0])[0]
defined_main_window = False defined_main_window = False