Sequential file name problem (Python/Picam)












0















I would be very grateful for some guidance on the following script. You will see that I have very little experience (3 days!).



Using the pantilthat servo control, I am taking a image (jpg) at various camera positions. This is in a continuous loop that will be run during daylight hours.



I am trying to save the images like so, 1.jpg, 2.jpg, 3.jpg..... 1.jpg, 2.jpg, 3.jpg.... etc etc



The code works, but I just cant figure out the file naming part.
Thank you for looking and any improvents gratefully received.





#!/usr/bin/env python
import pantilthat
import time
import picamera
x = 0
while x < 9:
print "Take Photo"
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.start_preview()
camera.annotate_text = 'Picture Taken with Raspberry camera'
time.sleep(2)
for filename in camera.record_sequence(
'image%02d.jpg' % i for i in range(1)):
print('Saving to %s' % filename)
camera.stop_preview()
print('Done')
x += 1
if x == 1:
print("1")
pantilthat.pan(30)
pantilthat.tilt(-10)
time.sleep(1)
elif x == 2:
print("2")
pantilthat.pan(20)
pantilthat.tilt(0)
time.sleep(1)
elif x == 3:
pantilthat.pan(10)
pantilthat.tilt(10)
print("3")
time.sleep(1)
elif x == 4:
pantilthat.pan(0)
pantilthat.tilt(-10)
print("4")
time.sleep(1)
elif x == 5:
pantilthat.pan(-10)
pantilthat.tilt(10)
print("5")
time.sleep(1)
elif x == 6:
pantilthat.pan(-20)
pantilthat.tilt(-20)
print("6")
time.sleep(1)
elif x == 7:
pantilthat.pan(-30)
pantilthat.tilt(20)
print("7")
time.sleep(1)
x=0
else:
pass









share|improve this question























  • According to the docs record_sequence records a sequence of video clips! picamera.readthedocs.io/en/release-1.10/… Don't you just want to capture one image each time the camera moves?

    – CoderMike
    Feb 3 at 17:42








  • 1





    you explained what filenames you want ..... you did not explain what filenames you get when you run the program

    – jsotola
    Feb 3 at 18:33






  • 1





    looks like your camera gets positioned after you take a picture .... is that how you want the program to behave?

    – jsotola
    Feb 3 at 19:20
















0















I would be very grateful for some guidance on the following script. You will see that I have very little experience (3 days!).



Using the pantilthat servo control, I am taking a image (jpg) at various camera positions. This is in a continuous loop that will be run during daylight hours.



I am trying to save the images like so, 1.jpg, 2.jpg, 3.jpg..... 1.jpg, 2.jpg, 3.jpg.... etc etc



The code works, but I just cant figure out the file naming part.
Thank you for looking and any improvents gratefully received.





#!/usr/bin/env python
import pantilthat
import time
import picamera
x = 0
while x < 9:
print "Take Photo"
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.start_preview()
camera.annotate_text = 'Picture Taken with Raspberry camera'
time.sleep(2)
for filename in camera.record_sequence(
'image%02d.jpg' % i for i in range(1)):
print('Saving to %s' % filename)
camera.stop_preview()
print('Done')
x += 1
if x == 1:
print("1")
pantilthat.pan(30)
pantilthat.tilt(-10)
time.sleep(1)
elif x == 2:
print("2")
pantilthat.pan(20)
pantilthat.tilt(0)
time.sleep(1)
elif x == 3:
pantilthat.pan(10)
pantilthat.tilt(10)
print("3")
time.sleep(1)
elif x == 4:
pantilthat.pan(0)
pantilthat.tilt(-10)
print("4")
time.sleep(1)
elif x == 5:
pantilthat.pan(-10)
pantilthat.tilt(10)
print("5")
time.sleep(1)
elif x == 6:
pantilthat.pan(-20)
pantilthat.tilt(-20)
print("6")
time.sleep(1)
elif x == 7:
pantilthat.pan(-30)
pantilthat.tilt(20)
print("7")
time.sleep(1)
x=0
else:
pass









share|improve this question























  • According to the docs record_sequence records a sequence of video clips! picamera.readthedocs.io/en/release-1.10/… Don't you just want to capture one image each time the camera moves?

    – CoderMike
    Feb 3 at 17:42








  • 1





    you explained what filenames you want ..... you did not explain what filenames you get when you run the program

    – jsotola
    Feb 3 at 18:33






  • 1





    looks like your camera gets positioned after you take a picture .... is that how you want the program to behave?

    – jsotola
    Feb 3 at 19:20














0












0








0








I would be very grateful for some guidance on the following script. You will see that I have very little experience (3 days!).



Using the pantilthat servo control, I am taking a image (jpg) at various camera positions. This is in a continuous loop that will be run during daylight hours.



I am trying to save the images like so, 1.jpg, 2.jpg, 3.jpg..... 1.jpg, 2.jpg, 3.jpg.... etc etc



The code works, but I just cant figure out the file naming part.
Thank you for looking and any improvents gratefully received.





#!/usr/bin/env python
import pantilthat
import time
import picamera
x = 0
while x < 9:
print "Take Photo"
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.start_preview()
camera.annotate_text = 'Picture Taken with Raspberry camera'
time.sleep(2)
for filename in camera.record_sequence(
'image%02d.jpg' % i for i in range(1)):
print('Saving to %s' % filename)
camera.stop_preview()
print('Done')
x += 1
if x == 1:
print("1")
pantilthat.pan(30)
pantilthat.tilt(-10)
time.sleep(1)
elif x == 2:
print("2")
pantilthat.pan(20)
pantilthat.tilt(0)
time.sleep(1)
elif x == 3:
pantilthat.pan(10)
pantilthat.tilt(10)
print("3")
time.sleep(1)
elif x == 4:
pantilthat.pan(0)
pantilthat.tilt(-10)
print("4")
time.sleep(1)
elif x == 5:
pantilthat.pan(-10)
pantilthat.tilt(10)
print("5")
time.sleep(1)
elif x == 6:
pantilthat.pan(-20)
pantilthat.tilt(-20)
print("6")
time.sleep(1)
elif x == 7:
pantilthat.pan(-30)
pantilthat.tilt(20)
print("7")
time.sleep(1)
x=0
else:
pass









share|improve this question














I would be very grateful for some guidance on the following script. You will see that I have very little experience (3 days!).



Using the pantilthat servo control, I am taking a image (jpg) at various camera positions. This is in a continuous loop that will be run during daylight hours.



I am trying to save the images like so, 1.jpg, 2.jpg, 3.jpg..... 1.jpg, 2.jpg, 3.jpg.... etc etc



The code works, but I just cant figure out the file naming part.
Thank you for looking and any improvents gratefully received.





#!/usr/bin/env python
import pantilthat
import time
import picamera
x = 0
while x < 9:
print "Take Photo"
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.start_preview()
camera.annotate_text = 'Picture Taken with Raspberry camera'
time.sleep(2)
for filename in camera.record_sequence(
'image%02d.jpg' % i for i in range(1)):
print('Saving to %s' % filename)
camera.stop_preview()
print('Done')
x += 1
if x == 1:
print("1")
pantilthat.pan(30)
pantilthat.tilt(-10)
time.sleep(1)
elif x == 2:
print("2")
pantilthat.pan(20)
pantilthat.tilt(0)
time.sleep(1)
elif x == 3:
pantilthat.pan(10)
pantilthat.tilt(10)
print("3")
time.sleep(1)
elif x == 4:
pantilthat.pan(0)
pantilthat.tilt(-10)
print("4")
time.sleep(1)
elif x == 5:
pantilthat.pan(-10)
pantilthat.tilt(10)
print("5")
time.sleep(1)
elif x == 6:
pantilthat.pan(-20)
pantilthat.tilt(-20)
print("6")
time.sleep(1)
elif x == 7:
pantilthat.pan(-30)
pantilthat.tilt(20)
print("7")
time.sleep(1)
x=0
else:
pass






python raspicam pi-zero






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 3 at 17:12









RixsterRixster

62




62













  • According to the docs record_sequence records a sequence of video clips! picamera.readthedocs.io/en/release-1.10/… Don't you just want to capture one image each time the camera moves?

    – CoderMike
    Feb 3 at 17:42








  • 1





    you explained what filenames you want ..... you did not explain what filenames you get when you run the program

    – jsotola
    Feb 3 at 18:33






  • 1





    looks like your camera gets positioned after you take a picture .... is that how you want the program to behave?

    – jsotola
    Feb 3 at 19:20



















  • According to the docs record_sequence records a sequence of video clips! picamera.readthedocs.io/en/release-1.10/… Don't you just want to capture one image each time the camera moves?

    – CoderMike
    Feb 3 at 17:42








  • 1





    you explained what filenames you want ..... you did not explain what filenames you get when you run the program

    – jsotola
    Feb 3 at 18:33






  • 1





    looks like your camera gets positioned after you take a picture .... is that how you want the program to behave?

    – jsotola
    Feb 3 at 19:20

















According to the docs record_sequence records a sequence of video clips! picamera.readthedocs.io/en/release-1.10/… Don't you just want to capture one image each time the camera moves?

– CoderMike
Feb 3 at 17:42







According to the docs record_sequence records a sequence of video clips! picamera.readthedocs.io/en/release-1.10/… Don't you just want to capture one image each time the camera moves?

– CoderMike
Feb 3 at 17:42






1




1





you explained what filenames you want ..... you did not explain what filenames you get when you run the program

– jsotola
Feb 3 at 18:33





you explained what filenames you want ..... you did not explain what filenames you get when you run the program

– jsotola
Feb 3 at 18:33




1




1





looks like your camera gets positioned after you take a picture .... is that how you want the program to behave?

– jsotola
Feb 3 at 19:20





looks like your camera gets positioned after you take a picture .... is that how you want the program to behave?

– jsotola
Feb 3 at 19:20










1 Answer
1






active

oldest

votes


















2














How about something like the following.



I'm using a list to store your pan and tilt values and capturing 1 image on each loop. Simply concatenating the string value of i onto 'image' followed by .'jpg' to create the image name.



#!/usr/bin/env python3
import pantilthat,time,picamera

panTilt = [[ 30, -10],
[ 20, 0],
[ 10, 10],
[ 0, -10],
[-10, 10],
[-20, -20],
[-30, 20],
[ 0, 0]]

camera=picamera.PiCamera()
camera.resolution = (1024, 768)
camera.annotate_text = 'Picture Taken with Raspberry camera'

for i,(pan,tilt) in enumerate(panTilt):
print("Take Photo")
camera.capture('image'+str(i)+'.jpg')
print(i,pan,tilt)
pantilthat.pan(pan)
pantilthat.tilt(tilt)
time.sleep(1)

camera.close()





share|improve this answer


























  • That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

    – Ghanima
    Feb 3 at 18:31













  • @CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

    – Rixster
    Feb 3 at 20:52











  • Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

    – Rixster
    Feb 3 at 20:53











  • I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

    – Rixster
    Feb 3 at 20:55











  • 'image%s.jpg'%i :P

    – somebody
    Feb 3 at 22:07











Your Answer






StackExchange.ifUsing("editor", function () {
return StackExchange.using("schematics", function () {
StackExchange.schematics.init();
});
}, "cicuitlab");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "447"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f93812%2fsequential-file-name-problem-python-picam%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














How about something like the following.



I'm using a list to store your pan and tilt values and capturing 1 image on each loop. Simply concatenating the string value of i onto 'image' followed by .'jpg' to create the image name.



#!/usr/bin/env python3
import pantilthat,time,picamera

panTilt = [[ 30, -10],
[ 20, 0],
[ 10, 10],
[ 0, -10],
[-10, 10],
[-20, -20],
[-30, 20],
[ 0, 0]]

camera=picamera.PiCamera()
camera.resolution = (1024, 768)
camera.annotate_text = 'Picture Taken with Raspberry camera'

for i,(pan,tilt) in enumerate(panTilt):
print("Take Photo")
camera.capture('image'+str(i)+'.jpg')
print(i,pan,tilt)
pantilthat.pan(pan)
pantilthat.tilt(tilt)
time.sleep(1)

camera.close()





share|improve this answer


























  • That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

    – Ghanima
    Feb 3 at 18:31













  • @CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

    – Rixster
    Feb 3 at 20:52











  • Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

    – Rixster
    Feb 3 at 20:53











  • I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

    – Rixster
    Feb 3 at 20:55











  • 'image%s.jpg'%i :P

    – somebody
    Feb 3 at 22:07
















2














How about something like the following.



I'm using a list to store your pan and tilt values and capturing 1 image on each loop. Simply concatenating the string value of i onto 'image' followed by .'jpg' to create the image name.



#!/usr/bin/env python3
import pantilthat,time,picamera

panTilt = [[ 30, -10],
[ 20, 0],
[ 10, 10],
[ 0, -10],
[-10, 10],
[-20, -20],
[-30, 20],
[ 0, 0]]

camera=picamera.PiCamera()
camera.resolution = (1024, 768)
camera.annotate_text = 'Picture Taken with Raspberry camera'

for i,(pan,tilt) in enumerate(panTilt):
print("Take Photo")
camera.capture('image'+str(i)+'.jpg')
print(i,pan,tilt)
pantilthat.pan(pan)
pantilthat.tilt(tilt)
time.sleep(1)

camera.close()





share|improve this answer


























  • That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

    – Ghanima
    Feb 3 at 18:31













  • @CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

    – Rixster
    Feb 3 at 20:52











  • Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

    – Rixster
    Feb 3 at 20:53











  • I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

    – Rixster
    Feb 3 at 20:55











  • 'image%s.jpg'%i :P

    – somebody
    Feb 3 at 22:07














2












2








2







How about something like the following.



I'm using a list to store your pan and tilt values and capturing 1 image on each loop. Simply concatenating the string value of i onto 'image' followed by .'jpg' to create the image name.



#!/usr/bin/env python3
import pantilthat,time,picamera

panTilt = [[ 30, -10],
[ 20, 0],
[ 10, 10],
[ 0, -10],
[-10, 10],
[-20, -20],
[-30, 20],
[ 0, 0]]

camera=picamera.PiCamera()
camera.resolution = (1024, 768)
camera.annotate_text = 'Picture Taken with Raspberry camera'

for i,(pan,tilt) in enumerate(panTilt):
print("Take Photo")
camera.capture('image'+str(i)+'.jpg')
print(i,pan,tilt)
pantilthat.pan(pan)
pantilthat.tilt(tilt)
time.sleep(1)

camera.close()





share|improve this answer















How about something like the following.



I'm using a list to store your pan and tilt values and capturing 1 image on each loop. Simply concatenating the string value of i onto 'image' followed by .'jpg' to create the image name.



#!/usr/bin/env python3
import pantilthat,time,picamera

panTilt = [[ 30, -10],
[ 20, 0],
[ 10, 10],
[ 0, -10],
[-10, 10],
[-20, -20],
[-30, 20],
[ 0, 0]]

camera=picamera.PiCamera()
camera.resolution = (1024, 768)
camera.annotate_text = 'Picture Taken with Raspberry camera'

for i,(pan,tilt) in enumerate(panTilt):
print("Take Photo")
camera.capture('image'+str(i)+'.jpg')
print(i,pan,tilt)
pantilthat.pan(pan)
pantilthat.tilt(tilt)
time.sleep(1)

camera.close()






share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 4 at 10:54

























answered Feb 3 at 18:13









CoderMikeCoderMike

2,5271513




2,5271513













  • That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

    – Ghanima
    Feb 3 at 18:31













  • @CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

    – Rixster
    Feb 3 at 20:52











  • Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

    – Rixster
    Feb 3 at 20:53











  • I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

    – Rixster
    Feb 3 at 20:55











  • 'image%s.jpg'%i :P

    – somebody
    Feb 3 at 22:07



















  • That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

    – Ghanima
    Feb 3 at 18:31













  • @CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

    – Rixster
    Feb 3 at 20:52











  • Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

    – Rixster
    Feb 3 at 20:53











  • I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

    – Rixster
    Feb 3 at 20:55











  • 'image%s.jpg'%i :P

    – somebody
    Feb 3 at 22:07

















That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

– Ghanima
Feb 3 at 18:31







That is a good way to significantly simplify the OP's code. To make it (imho) slightly more pythonic you could turn that while loop to: for i, (pan, tilt) in enumerate(panTilt): and use the i for counting up the filename and pan and tilt instead of panTilt[x][0]. `

– Ghanima
Feb 3 at 18:31















@CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

– Rixster
Feb 3 at 20:52





@CoderMike What a neat method you have provided with the table. I don't know why, but when I run your code, I get an error after image 6. I inserted a sleep period (60 secs) thinking it might be the camera not keeping up with instructions, but the error persisted. Do I need to keep the interpreter 'alive' ? This is the error message ;

– Rixster
Feb 3 at 20:52













Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

– Rixster
Feb 3 at 20:53





Exception in thread Thread-13 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner File "/usr/lib/python2.7/threading.py", line 1071, in run File "/usr/lib/python2.7/threading.py", line 614, in wait File "/usr/lib/python2.7/threading.py", line 364, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list

– Rixster
Feb 3 at 20:53













I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

– Rixster
Feb 3 at 20:55





I also noticed that the picam was 'on' permantly when I ran the code (as seen by the constant red LED). Would it not best to turn the camera off between images so as not to 'wear it out'? @Ghanima. Thanks for your suggestions to make it more 'pythonic', but I am struggling to make it work at all ! (Incidentally, the camera will be used to monitor an airfield) thanks again

– Rixster
Feb 3 at 20:55













'image%s.jpg'%i :P

– somebody
Feb 3 at 22:07





'image%s.jpg'%i :P

– somebody
Feb 3 at 22:07


















draft saved

draft discarded




















































Thanks for contributing an answer to Raspberry Pi Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f93812%2fsequential-file-name-problem-python-picam%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

File:DeusFollowingSea.jpg