So, I want to create a user text input field in Pygame, and I was told to look at a class module named inputbox. So I downloaded inputbox.py and imported into my main game file. Then I ran a function inside it and got an error:
Traceback (most recent call last): File "C:\Users\Dennis\Tournament\inputbox.py", line 64, in <module> if __name__ == '__main__': main() File "C:\Users\Dennis\Tournament\inputbox.py", line 62, in main print(ask(screen, "Name") + " was entered") File "C:\Users\Dennis\Tournament\inputbox.py", line 46, in ask display_box(screen, question + ": " + string.join(current_string,"")) AttributeError: 'module' object has no attribute 'join'
I tried running inputbox.py while it was on its own, and got the same error. I am using Python 3.3 and Pygame 3.3, so this can be a problem. I was told that many string functions have been removed recently. If someone knows what the problem is and can fix it, then here is the code: I would be sincerely grateful if anyone could fix this problem, since I have been trying to configure user inputs in Pygame for a long time. Thanks so much for the answers in advance.
# by Timothy Downs, inputbox written for my map editor
source share