v.2024-08-25
Parent Page

Python

  1. For Scripts to run we need Python to work
  2. Copy Scripts Folder over under roms
  3. Scripts to boot into attract mode
  4. Attract Mode

chmod +777

from /RetroPie/roms/scripts
run chmod +777 *.sh so we can exec scripts

Checking that Python is installed

Telnet in
Python is preinstalled in buster OS under /usr/bin/python3, etc.
python --version
returns
Python 2.7.16
python3 --version
Returns
Python3.7.3

/home/pi/py

I have been putting all my scripts here
create a new py folder under /home/pi/ and put our py scripts in it.
$mkdir py
copy python script here

Running a python script

python3 listDevices.py
I get evdev errors
So lets do libinstalls
sudo apt install python3-gpiozero
sudo apt-get install python3-pip
pip3 install evdev

python3 listDevices.py

/dev/input/event2 retrogame
/dev/input/event1 raspberrypi-ts
/dev/input/event0 soc:shutdown_button@3 gpio-keys/input0

retrogame

the scripts in home/pi/py are looking for dragonrise controller.
Need to change these to retrogame