n0bel / PiClock3

A Fancy Clock built around a monitor and a Raspberry Pi and python3 + pyqt5
MIT License
15 stars 5 forks source link

SyntaxError: Missing parentheses in call to 'print'. Did you mean print("map base url: " + self.baseurl)? #9

Open Angrenost1 opened 2 months ago

Angrenost1 commented 2 months ago

Hello n0bel, First, I think you PiClock really rocks. I am trying to install it on my Raspberry Pi model 4B with Raspbian Bullseye installed (the Pi would not start up with Stretch). I followed all command, but when I try to start the PiClock with the command "sh start.sh -n -s" I receive an error below. I really hope you can help me to solve. Regards Remco

Error

root@PiClock:~/PiClock# sh startup.sh -n -s Disabling screen blanking.... No protocol specified xset: unable to open display ":0" No protocol specified xset: unable to open display ":0" No protocol specified xset: unable to open display ":0" Setting sound to max (assuming Monitor Tv controls volume).... Checking for NeoPixels Ambilight... Starting NeoPixel Ambilight Service... Checking for GPIO Buttons... Starting gpio-keys Service... Checking for Temperature Sensors... gpio memmap: Operation not permitted Starting PiClock.... logging to screen. File "/root/PiClock/Clock/PyQtPiClock.py", line 1642 print "map base url: " + self.baseurl ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("map base url: " + self.baseurl)?

BertLindeman commented 2 months ago

Hello,

The error you see is a python3 message. Python3 requires parens where python2 did not.

I am not current with my knowledge about other PiClock repositories.

I see 3 options

  1. edit this python script so all print commands have parentheses.
  2. install python2 and use it for the PiClock
  3. find another repository forked from this one that is python3 ready

Long time ago I did the first. No rocket science, but nowadays there might be another repo more current.

Ah, found one see SerBrynden repositories

Bert

Angrenost1 commented 2 months ago

@BertLindeman Thanks for your quick reply. Will have a look at the link you send.

Angrenost1 commented 2 months ago

@BertLindeman I used the for of Ser Brynden and I confirm that it is working brilliantly. I now only have to figure out how to reduce the speed of the weather radar. Again thanks for your suggestion!

BertLindeman commented 2 months ago

which repository do you use? I assume PiClock (not PyClock3 as that is not yet ready). In PyQtPiClock.py

I see:


try:
    Config.radar_refresh
except AttributeError:
    Config.radar_refresh = 10  # minutes

So there is in the config:


metric = 0  # 0 = English, 1 = Metric
radar_refresh = 10  # minutes
weather_refresh = 30  # minutes

That should get you off ;-)

Bert