<jupyter_start><jupyter_text>Take Pictures in a folderThis notebook allows you to take multiple pictures in a folder Prerequistes and open camera<jupyter_code>import os
import glob
from pathlib import Path


from picamera import PiCamera
from time import sleep
from time import time

camera = PiCamera()

camera.resolution =(640,480)
print ("starting camera")
camera.start_preview()

sleep(5)

print ("camera ready")<jupyter_output><empty_output><jupyter_text>create folder if it isn't already there<jupyter_code>folder="folder1"

Path("/home/pi/camera/"+folder).mkdir(mode=0o755, parents=False, exist_ok=True)<jupyter_output><empty_output><jupyter_text>take a single pictureRun this cell multiple times to take multiple pictures<jupyter_code>epoch_time = int(time())
fname="/home/pi/camera/"+folder + "/image_%d.jpg" % epoch_time
print ("capture " + fname)
camera.capture(fname)<jupyter_output><empty_output><jupyter_text>close the camera again. Only run this cell after you have taken all pictures<jupyter_code>camera.stop_preview()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10150375939849623, 'fraction_numerical': 0.011278195488721804, 'mean_word_length': 7.875, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '377399', 'license': 'MIT', 'n_tokens_mistral': 353, 'n_tokens_neox': 339, 'n_words': 91, 'path': 'camera/TakePicturesInFolder.ipynb', 'repo_name': 'chtraver/CognitivePiJupyter', 'size': '1064'}