Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Относительные пути в Local Runner #271

Open
inaRGuaBle opened this issue Jul 21, 2019 · 2 comments
Open

Относительные пути в Local Runner #271

inaRGuaBle opened this issue Jul 21, 2019 · 2 comments

Comments

@inaRGuaBle
Copy link

Если запукать на винде локалраннер не из папки с локал ранером (например из таски в вижуал студио коде) ранер постоянно падает в ошибку. FileNotFoundError: [Errno 2] No such file or directory: 'sprites/flash.png'. видимо там нужно где-то указать пути не относительно рабочей директории , а относительно исполняемого питон файла

c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups>python c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\localrunner.py Traceback (most recent call last): File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\localrunner.py", line 76, in <module> pyglet.app.run() File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyglet\app\__init__.py", line 138, in run event_loop.run() File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyglet\app\base.py", line 142, in run self._run() File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyglet\app\base.py", line 154, in _run timeout = self.idle() File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyglet\app\base.py", line 275, in idle redraw_all = self.clock.call_scheduled_functions(dt) File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyglet\clock.py", line 346, in call_scheduled_functions item.func(now - item.last_ts, *item.args, **item.kwargs) File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\localrunner.py", line 49, in game_loop_wrapper is_game_over = loop.run_until_complete(Runner.game.game_loop()) File "C:\Program Files (x86)\Python37-32\lib\asyncio\base_events.py", line 579, in run_until_complete return future.result() File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\game_objects\game.py", line 355, in game_loop self.draw() File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\game_objects\game.py", line 345, in draw self.draw_bonuses() File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\game_objects\game.py", line 325, in draw_bonuses bonus.draw() File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\game_objects\bonuses.py", line 39, in draw draw_square_with_image((self.x, self.y), self.color, self.image_path, self.active_ticks) File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\helpers.py", line 182, in draw_square_with_image img = load_image(image_path) File "c:\Users\oooo\Desktop\quests\aicup_mimi_4\repoclone\miniaicups\paperio\local_runner\helpers.py", line 169, in load_image img = pyglet.image.load(path) File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyglet\image\__init__.py", line 180, in load file = open(filename, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'sprites/flash.png'

@inaRGuaBle
Copy link
Author

простой фикс, для тех кто не понимает питон
в файлике bonuses.py строки sprites/*.png
заменить на полные пути на вашем компьютере

@NetLagina
Copy link
Contributor

Даже уже сделали #258, но не спешат мерджить.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants