From 20604764802395a33214e2d9cd4d0b04e11ade31 Mon Sep 17 00:00:00 2001 From: blast0r Date: Sun, 1 Apr 2018 11:39:38 +0200 Subject: [PATCH] use start.sh to spawn multiple instances, change eh18-image.py to accept image as parameter --- eh18-image.py | 8 ++++---- start.sh | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 start.sh diff --git a/eh18-image.py b/eh18-image.py index 33f27fe..4b45ab5 100644 --- a/eh18-image.py +++ b/eh18-image.py @@ -18,9 +18,9 @@ flutheight = 1080 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((TCP_IP, TCP_PORT)) - +image=sys.argv[1] #image name #Load the Image -im = Image.open("chaoswest-logo.png") +im = Image.open(image) rgb_im = im.convert('RGBA') width, height = im.size #get image size @@ -31,8 +31,8 @@ def randomnumber(pseed,pmin,pmax,v1,v2,v3): newseed=(int)(time.time()/60) #seed based on timestamp (full minutes) seed=newseed -user=int(sys.argv[1]) #1..n -parts=int(sys.argv[2]) #n users +user=int(sys.argv[2]) #1..n +parts=int(sys.argv[3]) #n users if __name__ == '__main__': pixelcoords=[] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..0dca826 --- /dev/null +++ b/start.sh @@ -0,0 +1,7 @@ +#!/bin/bash +maxCount=10 +fileName=ctdo.png +for i in $( seq 1 $maxCount); do + echo starting $i of $maxCount + python3 eh18-image.py $fileName $i $maxCount & +done