From ae6671fff6676992c2315499dc6391e2dd314358 Mon Sep 17 00:00:00 2001 From: lowrussia Date: Tue, 12 Nov 2019 21:34:16 +0100 Subject: [PATCH] second commit --- README.md | 16 ++++++++++++++++ ...ariat-image-roulette.py => image-roulette.py} | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) rename cgi-bin/{entreprecariat-image-roulette.py => image-roulette.py} (99%) diff --git a/README.md b/README.md index e69de29..babecde 100644 --- a/README.md +++ b/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) diff --git a/cgi-bin/entreprecariat-image-roulette.py b/cgi-bin/image-roulette.py similarity index 99% rename from cgi-bin/entreprecariat-image-roulette.py rename to cgi-bin/image-roulette.py index be97171..6befc24 100755 --- a/cgi-bin/entreprecariat-image-roulette.py +++ b/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()