Python Forum
Help with pygame but not an actual game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with pygame but not an actual game
#1
Hi all
I'm very new to Python and programming other than in Basic many years ago
I'm trying to get an Earthquake monitor working as Link to original project and code

I am able to get it working if I use a headless setup on a Pi 3b+ but with Raspbian lite only
It will not work on any other OS setup I have tried

I want it to work with the full version of Raspbian Debian version: 11 (bullseye) so it can be kept up to date and I can eventually if wanted integrate it into another project I have

The other project uses pygame but with the desktop version of Raspbian so I really need to figure out why it won't work

If anyone can help?

The error I get when I run it on the standard version of Bullseye is
pi@Earthquake:~ $ cd EQMap
pi@Earthquake:~/EQMap $ python3 EQMap.py
New Event
Traceback (most recent call last):
  File "/home/pi/EQMap/EQMap.py", line 155, in <module>
    main()
  File "/home/pi/EQMap/EQMap.py", line 137, in main
    repaintMap();
  File "/home/pi/EQMap/EQMap.py", line 61, in repaintMap
    displayManager.displayMagnitude(cqMag)
  File "/home/pi/EQMap/DisplayManager.py", line 144, in displayMagnitude
    self.drawCenteredText(self.topTextRow, "Mag: " + str(mag))
  File "/home/pi/EQMap/DisplayManager.py", line 96, in drawCenteredText
    textSurface, rect = self.font.render(text, 1, self.textColor)
TypeError: fgcolor must be a Color
pi@Earthquake:~/EQMap $ 
IF I bypass that error by assigning a color (which don't want to do as the color changes during the program run)
It gets a bit further then gives this error:
pi@Earthquake:~/EQMap $ python3 EQMap.py
New Event
Traceback (most recent call last):
  File "/home/pi/EQMap/EQMap.py", line 155, in <module>
    main()
  File "/home/pi/EQMap/EQMap.py", line 137, in main
    repaintMap();
  File "/home/pi/EQMap/EQMap.py", line 79, in repaintMap
    displayManager.mapEarthquake(lon, lat, mag, color)
  File "/home/pi/EQMap/DisplayManager.py", line 134, in mapEarthquake
    self.drawCircle(mapX, mapY, radius, color);
  File "/home/pi/EQMap/DisplayManager.py", line 119, in drawCircle
    pygame.draw.circle(self.screen, color, (x, y), radius, width=2)
TypeError: circle() takes no keyword arguments
pi@Earthquake:~/EQMap $ 
Can anyone tell me how to get this to run on a Pi that isn't headless and has a monitor attached to it?

It will "eventually" be merged with my weather display which is why I need it working on a proper monitor

I did contact the author of the project but he said he's moved onto other things.
I've attached the 2 sections of code that it relates to

Attached Files

.py   DisplayManager.py (Size: 5.25 KB / Downloads: 177)
.py   EQMap.py (Size: 3.45 KB / Downloads: 147)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Client Server Game Pygame not responding Damien 2 3,151 Aug-04-2018, 06:19 PM
Last Post: micseydel
  Pygame*import pygame ImportError: No module named pygame CASPERHANISCH 1 9,762 Jun-05-2017, 09:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020