擅长:python、mysql、java
<p>你的任务可以(我认为必须)用纯Python实现。下面是其解决方案的一个可能的变体,只使用Python,不使用外部脚本或库</p>
<pre><code>pipelst = str(raw_input('Enter pipe separated list : ')).split('|')
filepath = 'test.txt' # specify path to your file here
for lns in open(filepath):
split_pipe = lns.split(':', 1)
if split_pipe[0] in pipelst:
print split_pipe[0], ' details : ', split_pipe[1]
pipelst.remove(split_pipe[0])
for lns in pipelst : print lns,' is wrong input'
</code></pre>
<p>正如你所看到的,这是一个简短,简单和明确。在</p>