コンソールを使わずに運用する場合でも自力でシャットダウンができないと何かと不便なので、スイッチでシャットダウンできるようにしました。 参考にしたサイト http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio 準備 まず、以下のように対話モードでpythonを実行し、RPi.GPIOのバージョンが0.5.1以上であることを確認します。 % sudo python Python 2.7.3 (default, Jan 13 2013, 11:20:46) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import RPi.GPIO
![Raspberry Pi にシャットダウンボタンをつける - 猫ぱーんち!](https://cdn-ak-scissors.b.st-hatena.com/image/square/57c4dd3c63c23ff466fa52672d8093bd7d60a864/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fp%2Fpenkoba%2F20130926%2F20130926005508.jpg)