【发布时间】:2021-05-22 02:15:52
【问题描述】:
你好我正在使用python结合txt文件,想让我的代码搜索单词的一部分,就像我的txt文件看起来像这样=
'www.test.com/product/wings' , 'www.test1.com/product/chicken' , 'www.okay.com/product/burger' , 'www.Test23542.com/product/smoothie'
所以我想让我的代码打开文件并搜索“www.test1.com/product/”,它应该打印出完整的链接,包括像 = 'www.test1.com/product/ 这样的产品鸡'
我被卡住了,不知道该怎么做,所以我当前的代码不会真正有帮助,因为它只有一行。
【问题讨论】: