Hi all,
I tried an shutdown script for my pi. But I get an error when I execute it.
I guess I need an extra package for the import command? But which one is it?
Thats what I installed:
#Installation
sudo apt-get update
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install python-dev
sudo apt-get install build-essential
export ARCH=arm
export CROSS_COMPILE=/usr/bin/
sudo pip install wheel
sudo pip install rpi.gpio
But I get an error for my script when i want to use:
- import RPi.GPIO as GPIO
- import os
- import time
- GPIO.setmode(GPIO.BOARD)
./shutdown.py: line 4: import: command not found
./shutdown.py: line 5: import: command not found
./shutdown.py: line 6: import: command not found
./shutdown.py: line 8: syntax error near unexpected token GPIO.BOARD' ./shutdown.py: line 8:
GPIO.setmode(GPIO.BOARD)’