Closed chraibi closed 4 years ago
Thanks for your interest. It seems that the source code is able to run on your computer, and there may be something wrong with pygame. I do not know why the simulation screen is blank.
Yes. You are supposed to see three circles moving around. The simulation was recorded in 3Particles.swf. So do you run any other Python program with pygame? So others are OK and only this one is blank on screen? Please let me know whether you can debug it or not. I compiled the code in Python 2.7 with Pygame 1.9. Based on your description, it seems that pygame.draw.line() and pygame.draw.circle() does not output on the screen.
Sorry for the error about tabs and spaces. In fact the text edior confuses me a little. I previously selected TABS and SPACES, and it caused an unexpected problem as you mentioned. So I should only use SPACES and set TAB = 4 spaces. Is that right? Anyway, you are also welcome to give a pull request if you have already fixed this error.
I use pygame 1.9.5 and Python 3.7.3. I did not check other pygame-examples. Just wanted to see what this simulation is all about.. Yes, four spaces everywhere seem to be a good idea.
Please try the following program to test the pygame in Python 3.7. If it does not work in your computer, it is probably a setup problem of pygrame with Python 3.7. I am not sure. Just try it. There is no problem in computational model in the existing code. Thank you for your question.
The problem may be related to pygame._view.
When I use py2exe to get an execuable, the execuable file is successfully produced. However, when I run it, it returns the following error message. I think the these problems are perhaps related issues.
C:\Documents and Settings\WP\Desktop\PySim\Test_py2exe\dist>simulator_WP_Doorway
.exe
simulator_WP_Doorway.exe:4: RuntimeWarning: import display: No module named _view
(ImportError: No module named _view)
simulator_WP_Doorway.exe:4: RuntimeWarning: import draw: No module named _view
(ImportError: No module named _view)
simulator_WP_Doorway.exe:4: RuntimeWarning: import image: No module named _view
(ImportError: No module named _view)
simulator_WP_Doorway.exe:4: RuntimeWarning: import pixelcopy: No module named _view
(ImportError: No module named _view)
simulator_WP_Doorway.exe:4: RuntimeWarning: import transform: No module named _view
(ImportError: No module named _view)
Traceback (most recent call last):
File "simulator_WP_Doorway.py", line 5, in <module>
File "pygame\draw.pyc", line 12, in <module>
File "pygame\draw.pyc", line 10, in __load
File "pygame\surface.pyc", line 12, in <module>
File "pygame\surface.pyc", line 10, in __load
ImportError: No module named _view
OK. So the developers of Pygame replied that the problem is related to OSX for mac users. The details are listed as below.
"Looking at the linked issue on the other github repo I'm almost certain this is just the standard 'modern OSX doesn't work with pygame 1/SDL1' issue we get reported every other week. Don't think there is any work for pygame here, other than telling people on mac to use pygame 2 whenever they ask, so I think I'll close this for now." --- By MyreMylar commented May 31, 2020
After fixing some nasty errors related to mixed spaces and tabs, I run
and see an empty windows
After clicking on the red x (close the window) a new window pops up
Closing this one closes also the other one, and that's it.
Am I supposed to see some circles moving around or not? 🤔