I have started coding a program in Python 3 for the Raspberry Pi Camera, here is what my code looks like:
import picamera, time
def Picture_Name_Settings():
pic_name = input("To name the image input N\nTo use automatic naming input A ")
pic_name = pic_name.upper()
if pic_name == "N":
user_name = input("Please enter the name of what you want your image to be called ")
if pic_name == "A":
current_time = (time.strftime("%H:%M:%S"))
current_date = (time.strftime("%d:%m:%Y"))
automatic_name = ("Image taken at", current_time, "on the", current_date, "jpeg")
print(automatic_name)
camera = picamera.PiCamera()
camera.capture(automatic_name)
print("Took the picture")
Picture_Name_Settings()
And the error I get when it is run and after inputting "a" is:
'Format must be specified when output has no filename'
picamera.exc.PiCameraValueError: Format must be specified when output has no filename
Why am I getting this error? And why can I not put a variable containing the filename and type into the camera.capture brackets?