Я не могу открыть окно пиглета ⇐ Android
Я не могу открыть окно пиглета
As you can see in the code it will not let me run a pyglet window
~/python $ python fourthtry.py Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/__init__.py", line 335, in __getattr__ return getattr(self._module, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'Window' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/data/com.termux/files/home/python/fourthtry.py", line 3, in window = pyglet.window.Window(500,500) # screen width,height ^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/__init__.py", line 341, in __getattr__ __import__(import_name) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/window/__init__.py", line 1913, in gl._create_shadow_window() File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/gl/__init__.py", line 200, in _create_shadow_window _shadow_window = ShadowWindow() ^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/gl/__init__.py", line 194, in __init__ super().__init__(width=1, height=1, visible=False) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/window/xlib/__init__.py", line 168, in __init__ super(XlibWindow, self).__init__(*args, **kwargs) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/window/__init__.py", line 546, in __init__ display = pyglet.canvas.get_display() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/canvas/__init__.py", line 94, in get_display return Display() ^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/canvas/xlib.py", line 123, in __init__ raise NoSuchDisplayException('Cannot connect to "%s"' % name) pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None" Expecting a black window to appear so I can start putting in shapes to make a game
Edit here is the code of fourth.py:
import pyglet # import module window = pyglet.window.Window(500,500) # screen width,height pyglet.app.run() # update or run
Источник: https://stackoverflow.com/questions/780 ... let-window
As you can see in the code it will not let me run a pyglet window
~/python $ python fourthtry.py Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/__init__.py", line 335, in __getattr__ return getattr(self._module, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'Window' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/data/com.termux/files/home/python/fourthtry.py", line 3, in window = pyglet.window.Window(500,500) # screen width,height ^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/__init__.py", line 341, in __getattr__ __import__(import_name) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/window/__init__.py", line 1913, in gl._create_shadow_window() File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/gl/__init__.py", line 200, in _create_shadow_window _shadow_window = ShadowWindow() ^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/gl/__init__.py", line 194, in __init__ super().__init__(width=1, height=1, visible=False) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/window/xlib/__init__.py", line 168, in __init__ super(XlibWindow, self).__init__(*args, **kwargs) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/window/__init__.py", line 546, in __init__ display = pyglet.canvas.get_display() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/canvas/__init__.py", line 94, in get_display return Display() ^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyglet/canvas/xlib.py", line 123, in __init__ raise NoSuchDisplayException('Cannot connect to "%s"' % name) pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None" Expecting a black window to appear so I can start putting in shapes to make a game
Edit here is the code of fourth.py:
import pyglet # import module window = pyglet.window.Window(500,500) # screen width,height pyglet.app.run() # update or run
Источник: https://stackoverflow.com/questions/780 ... let-window
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение