[raspberry-vi] Re: error in code question

  • From: Geoff Shang <geoff@xxxxxxxxxxxxxxx>
  • To: raspberry-vi@xxxxxxxxxxxxx
  • Date: Thu, 15 Apr 2021 13:29:23 +0300 (IDT)

On Wed, 14 Apr 2021, Glenn K0LNY wrote:

I got an error in a shell script when I ran it with python, it said syntax 
error
I had:
sudo aplay /home/pi/startup.wav
This usually runs from the command line.

I don't know whether you meant to just run this command or you meant to 
run it as part of Python code.

Perhaps I'm stating the obvious, but Python is a programming language and 
the Python interpreter is for running programs written in Python.

If all you want to do is execute this command, you can get a shell such as 
sh or bash to run it.

Maybe give us some more information.

Oh and you may want to make your life a lot easier by getting sudo out of 
the picture.

I don't have a pi running currently, but I'm guessing that your user 
account lacks the needed permissions to read the file.

I would either add your user to a group which can read it or change the 
permissions on the file so that your user can read it.

Cheers,
Geoff.

=========================================================== 
The raspberry-vi mailing list 
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi 
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and 
attitudes expressed by the subscribers to this list do not reflect those of the 
Foundation.

Mike Ray, list creator, January 2013

Other related posts: