ฉันมีรหัสหลามง่าย ๆ ที่ค้นหาไฟล์สำหรับสตริงเช่น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=คืออะไร?