Use the following piece of code:
x1=datetime.timedelta(days=3000, seconds=0, microseconds=0, milliseconds=0, minutes=40, hours=5, weeks=8)
x2=datetime.timedelta(days=345, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=4, weeks=8)
x3=x1-x2
x5 = x3.total_seconds()
print(x5)
OUTPUT:
229398000.0