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

TypeError: slice indices must be integers or None or have an __index__ method #9

Open
c1a1o1 opened this issue Jul 8, 2018 · 5 comments

Comments

@c1a1o1
Copy link

c1a1o1 commented Jul 8, 2018

File "c:\users\caocao\anaconda3\lib\site-packages\pypokergui\server\message_manager.py", line 82, in broadcast_update_game
message = _gen_game_update_message(handler, update)
File "c:\users\caocao\anaconda3\lib\site-packages\pypokergui\server\message_manager.py", line 114, in _gen_game_update_message
table_html_str = handler.render_string("round_state.html", round_state=round_state)
File "c:\users\caocao\anaconda3\lib\site-packages\tornado\web.py", line 826, in render_string
return t.generate(**namespace)
File "c:\users\caocao\anaconda3\lib\site-packages\tornado\template.py", line 348, in generate
return execute()
File "round_state_html.generated.py", line 53, in _tt_execute
for idx, player in zip(range(len(round_state['seats']))[:len(round_state['seats'])/2], round_state['seats']): # round_state.html:22
TypeError: slice indices must be integers or None or have an index method

@liangdongutexas
Copy link

I have come across the same issue. Do you find how to solve it? Thanks.

@alexyalunin
Copy link

#6

@dhaeb
Copy link

dhaeb commented Oct 12, 2019

Well yesterday I tried to get the whole SW to work cause it's a great project :)
Unfortunately, this error is still a thing in the official currently released version.

I tried to apply the fix given in this issue description and It brang the template back to life. However, since applying the bugfix no players (and their current action) are shown in the GUI on the website. It looks like this:
image
I wasn't able to dive deep into the python template because it's a hackish (but cool) functional expression. But the current result is that no html for the players is created .

Does someone encounter the same problems? Does anyone solved this already in more detail? If not, I will dive more deeper when there is more time for this on my side.

Best,

Dan

@dhaeb
Copy link

dhaeb commented Oct 13, 2019

Ok guys I found the error, it's quite simple. I must have deleted accidentally the

  {% include "player_game.html" %}

which needs to be put in between the fix #6 and

{%  end %}

So the software is working using the proposed fix #6.

@wangxk15
Copy link

Ok guys I found the error, it's quite simple. I must have deleted accidentally the

  {% include "player_game.html" %}

which needs to be put in between the fix #6 and

{%  end %}

So the software is working using the proposed fix #6.

Thanks but I still get the same error, which sentence and which file exactly should we correct? The error shown here is still "string indices must be integers"

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

5 participants