random - Need some precisions to randomise in Python -


I have managed to write a small code but my skills are very bad (though I am doing my best) P>

I want to print images from a camera. But even though the camera will shoot a picture every 30 seconds, I want to print the images in random breaks (between 3 and 10 minutes) of time

Can anyone help me? Thank you very much

Even the code I have done so far.

Referred to: fpath = os .path.join (monRep, fname) if os.path.isfile (fpath): mt = mimetypes.guess_type (fpath) [0] ext = Os.path.splitext (fpath) [1] If mt: mt = mt Split ('/') [0]. Lotus () and: mt = wrong #if (.bmp ',' .ppt ',' .jpg ',' .jpg ',' .pdf ') in ext.lower (): mt =' image 'if MT ('Image',): fpathsappend (fpath) for fpaths in fpaths: newpath = fpath ('*** / folder1 /', '*** / folder2 /') os.rename (fpath, newpath) Command = "lpr" + newpath print (command) os.system (command) Import time period. Sleep (1) directory = '*** / folder2 /' os.chdir (directory) files = glob.glob ('* .JPG') for file name in files: os.unlink (filename)

it run a script because it should be free from import code:

< pre> Import true while importing import: directory = "*** / folder 1 / files' = Globkglob (" *. jpg ") # selected jpg files in your DR _ selected_file = random .choice (files) #f Ilen '# select a random entry in the selected file drunken = random.randint (3 * 60, 11 * 60) # 3 and select random numbers between 11 minutes (in seconds) TimekSleep (SOP) # And sleep for that time

Comments