Python Forum
Idea of timelapse with automatic settings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Idea of timelapse with automatic settings
#3
g_iso = 100
call(["gphoto2","--set-config","iso=%d" % g_iso])
The format command (either as "text with %% %f" % 4.5 or "text with {{} {:f}".format(4.5)) only works with string (and bytes in python3)

If for example you want to write your g_f with 2 decimal places you can use:
    print "%.2f" % g_f
    call(["gphoto2","--set-config","F-Number=%.2f" % g_f])
And for the last line:
import os
from datetime import datetime
name = datetime.now().strftime("%Y_%m_%d_%H_%M_%S.arw")
call (["gphoto2","--capture-image-and-download","--filename", os.path.join("/media/pi/6CD8-2DB4/images", name)])
One side note, you are using python 2.7 for a new project... I rather recommend to use python3 except if there is no other option. The syntax is more uniform, easier to learn and to work with raw binary data is nicer, once you get used to the bytes type.
Reply


Messages In This Thread
RE: Idea of timelapse with automatic settings - by killerrex - May-26-2018, 01:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information automatic document renaming lisa_d 2 357 Mar-20-2024, 06:34 PM
Last Post: Pedroski55
  Save settings frohr 3 1,546 May-14-2022, 12:38 PM
Last Post: frohr
  Matplotlib - automatic update frohr 1 1,110 Mar-29-2022, 07:05 PM
Last Post: deanhystad
  automatic create folders Mr_Kool 4 1,782 Dec-21-2021, 04:38 PM
Last Post: BashBedlam
  Automatic user/password entry on prompt by bash script PBOX_XS4_2001 3 2,793 May-18-2021, 06:42 PM
Last Post: Skaperen
  PyCharm - 'unable to save settings' Taguero 1 4,280 Jun-12-2020, 06:18 PM
Last Post: Larz60+
  Automatic registering python to registry kozaizsvemira 1 2,201 Oct-22-2019, 11:23 AM
Last Post: kozaizsvemira
  TimeLapse Help - ImportError: No module named 'sh' evvvonder 4 4,412 Jun-28-2019, 10:52 PM
Last Post: evvvonder
  Automatic redefining Hassediagram 5 3,302 Feb-25-2019, 01:36 PM
Last Post: Hassediagram
  [Automation] Mouse Settings masch1na 1 3,588 Apr-10-2018, 12:49 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020