-1

Hello i am using python combined with txt file and want to let my code search for parts of a word, like my txt file looks like this =

'www.test.com/product/wings' , 'www.test1.com/product/chicken' , 'www.okay.com/product/burger' , 'www.Test23542.com/product/smoothie'

So and i want to let my code open the file and search for 'www.test1.com/product/' and it should print out the complete link, included the product like = 'www.test1.com/product/chicken'

I am stuck and dont know how to do it so my current code wont really help because its just one line.

Yves1234
  • 35
  • 1
  • 7

1 Answers1

0

Here is an example. Use open and then read or readline to read in the date in the file and then use str() methods to find what you need,

Sun Bear
  • 7,594
  • 11
  • 56
  • 102