How do I create a popup window in tkinter?

I found 3 mistakes use Toplevel() instead of Tk() to create second/third window command= expects callback – function name without ()(but you use popupBonusWindow.destroy()) don’t mix pack() and grid() in one window or frame(but you use grid() and pack() in popup) But you can also use built-in messageboxes like showinfo() BTW: I put it on page: Tkinter: How to create popup Window or Messagebox

Type error Unhashable type:set

The individual items that you put into a set can’t be mutable, because if they changed, the effective hash would change and thus the ability to check for inclusion would break down. Instead, you need to put immutable objects into a set – e.g. frozensets. If you change the return statement from your enum method to… …then it … Read more

Virtualenv – workon command not found

So far it was working fine but I restarted the shell The reason is because you restarted the shell. If you want this to work with each shell, you’ll need to add these to your ~/.bashrc file: After adding this, you’ll want to source ~/.bashrc so the changes take effect. You’ll find that you have access to virtualenvwrapper facilities in each new … Read more

Python sockets error TypeError: a bytes-like object is required, not ‘str’ with send function

The reason for this error is that in Python 3, strings are Unicode, but when transmitting on the network, the data needs to be bytes instead. So… a couple of suggestions: Suggest using c.sendall() instead of c.send() to prevent possible issues where you may not have sent the entire msg with one call (see docs). For literals, add a ‘b’ for bytes … Read more

Shebang doesn’t work with python3

Generally, take care of some pitfalls: set the executable flag on the script: chmod u+x test.py try to execute with a preceding dot “./”, so call ./test.py otherwise it might execute some other script from within your PATH also make sure you don’t have windows line endings, this seems to prevent the shebang evaluation, too. There are some suggestions around, e.g. in this answer, on … Read more