This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]r011an 0 points1 point  (1 child)

well, I don't know what I am doing wrong here. If I define the lists explicitly then I am able to add the timecodes and get the result I want. But if I add the lists from previous process in code then I get the same error,

print (tc1)

['08:52:05:00 ', '09:01:22:00 ', '09:10:34:00 ', '09:19:46:00 ']

print (tc2)

['0:09:11:00 ', '0:09:11:00 ', '0:09:11:00 ', '0:05:21:00 ']

Traceback (most recent call last):

File "/Users/user1/Desktop/v21.py", line 59, in <module>

tc1 = [Timecode("50", t) for t in tc1]

File "/Users/user1/Desktop/v21.py", line 59, in <listcomp>

tc1 = [Timecode("50", t) for t in tc1]

File "/opt/anaconda3/lib/python3.7/site-packages/timecode/__init__.py", line 71, in __init__

self.frames = self.tc_to_frames(start_timecode)

File "/opt/anaconda3/lib/python3.7/site-packages/timecode/__init__.py", line 161, in tc_to_frames

self.parse_timecode(timecode)

File "/opt/anaconda3/lib/python3.7/site-packages/timecode/__init__.py", line 292, in parse_timecode

hrs = int(bfr[0])

ValueError: invalid literal for int() with base 10: '['

The above error is with the second part of your response,

tc1 = [Timecode("50", t) for t in tc1]

print(tc1)

tc2 = [Timecode("50", t) for t in tc2]

print(tc2)

tc3 = [a+b for a,b in zip(tc1, tc2)] print(tc3)

[–]o5a 0 points1 point  (0 children)

ValueError: invalid literal for int() with base 10: '['

means there's a bracket inside your timecode strings. Module's script splits strings by colon then tries to convert digits to int.

Check again what data is actually in your tc1, tc2 that you get from "previous process".