Q:

print everything after specific substring

I am trying to print content after a datetime string.Like if its todays date 09-04-2019(mm-dd-yy) i want to print everything when the 09042019 string starts.It wont print anything before that.I formatted the date according to string.But not being able to print after that date substring.this is what i have done so far:
from datetime import datetime

now = datetime.now() # current date and time

year = now.strftime("%Y")
month = now.strftime("%m")
day = now.strftime("%d")
date_time = now.strftime("%m%d%Y")
d=str(date_time)
print(d)
content='''(1115 09032019) Arafat hello
(1116 09032019) Arafat a
(1116 09032019) Arafat b
(1117 09032019) space w
(1117 09042019) space a
(1117 09042019) space a'''
print(content)

body=content[:content.find(d)]

I want the output to be like this when the 09042019 starts
(1117 09042019) space a
(1117 09042019) space a

A:

If I understand it correctly, you want to print everything starting with the line containing the variable d. If that is the case, the following code should do what you want:
import itertools

content='''(1115 09032019) Arafat hello
(1116 09032019) Arafat a
(1116 09032019) Arafat b
(1117 09032019) space w
(1117 09042019) space a
(1117 09042019) space a'''
d = '09042019' # Hardcoded for testing

# Skip (drop) all the lines until we see 'd'
lines = iter(content.splitlines())
lines = itertools.dropwhile(lambda line: d not in line, lines)

# Print the rest of the lines
for line in lines:
    print(line)

Notes

The itertools.dropwhile will skip lines until it encounters the line containing varible d for the first time.
After that, just print out the rest of the lines and we are done

