We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8d4a04 commit 9410a21Copy full SHA for 9410a21
examples/timestamp_filename/code.py
@@ -47,7 +47,14 @@
47
try:
48
pycam.display_message("snap", color=0x00DD00)
49
# pylint: disable=line-too-long
50
- timestamp = f"img_{time.localtime().tm_year}-{time.localtime().tm_mon}-{time.localtime().tm_mday}_{time.localtime().tm_hour:02}-{time.localtime().tm_min:02}-{time.localtime().tm_sec:02}_"
+ timestamp = "img_{}-{}-{}_{:02}-{:02}-{:02}_".format(
51
+ time.localtime().tm_year,
52
+ time.localtime().tm_mon,
53
+ time.localtime().tm_mday,
54
+ time.localtime().tm_hour,
55
+ time.localtime().tm_min,
56
+ time.localtime().tm_sec,
57
+ )
58
pycam.capture_jpeg(filename_prefix=timestamp)
59
pycam.live_preview_mode()
60
except TypeError as exception:
0 commit comments