擅长:python、mysql、java
<pre><code>print ("Enter first the source file and then destination file with respective format")
t=input() #Enter source file
t1=input() #Enter destination file
print ("Enter the keyword which has to be copied into another file")
find=input() #Enter the keyword which has to be copied
f=open(t) #Open the source file
f1=open(t1,"a+") #Open the destination file in append and read mode
Copy_Lines=False
for line in f.readlines():
if find in line:
Copy_Lines=True
if Copy_Lines:
f1.write(line)
f1.close()
f.close()
print("Task completed")
</code></pre>