我是Python
的新手。我想从一次减去 1秒。我尝试了下面的代码:
inp_time = "15:30:40.740"
out_time = datetime.time(int(inp_time[:2]), int(inp_time[3:5]), int(inp_time[6:8]), int(inp_time[-3:]))
x=1
from_time = datetime.time(out_time) - datetime.timedelta(seconds=x)
我收到错误:
TypeError: an integer is required (got type datetime.time).