我有一些简单的python代码,可在文件中搜索字符串,例如path=c:\path
,其中c:\path
部分可能会有所不同。当前代码是:
def find_path(i_file):
lines = open(i_file).readlines()
for line in lines:
if line.startswith("Path="):
return # what to do here in order to get line content after "Path=" ?
取得文字的简单方法是什么Path=
?