Browse Source

second commit

master
lowrussia 1 year ago
parent
commit
ae6671fff6
  1. 16
      README.md
  2. 2
      cgi-bin/image-roulette.py

16
README.md

@ -0,0 +1,16 @@
# Image Roulette
A cgi-bin python script that picks up a random image from a directory and its subdirectories and show it in a browser.
## Usage
1. Place `image-roulette.py` into a directory named `cgi-bin`
2. Navigate to the directory containing the `cgi-bin` one
3. Launch a server with the command: `$ python3 -m http.server --cgi`
4. Open your browser on: http://0.0.0.0:8000/cgi-bin/image-roulette.py
5. Press ENTER to load a new image
## TODO
- insert main directory and title of gallery as parameters
- add automatic mode (reload every x seconds)

2
cgi-bin/entreprecariat-image-roulette.py → cgi-bin/image-roulette.py

@ -3,7 +3,7 @@
import os, random, base64
dir ='../'
dir ='.'
extensions = [ '.ras', '.xwd', '.bmp', '.jpe', '.jpg', '.jpeg', '.xpm', '.ief', '.pbm', '.tif', '.gif', '.ppm', '.xbm', '.tiff', '.rgb', '.pgm', '.png', '.pnm']
imgs = list()
Loading…
Cancel
Save