python14

作者: rong酱 | 来源:发表于2021-08-11 10:55 被阅读0次
# -*- coding: utf-8 -*-
#!/usr/bin/env python

import os
import sys

in1 = sys.argv[1]
in2 = sys.argv[2]
ou1 = sys.argv[3]

dictin1 = {}
with open(in1,"r") as in1ss:
    in1s = in1ss.readlines()
    for in1l in in1s[1:]:
        in1li = in1l.strip().split("\t")
        dictin1[in1li[0]] = in1li[1]

outcon = open(ou1,"w")
with open(in2,"r") as in2ss:
    in2s = in2ss.readlines()
    for in2l in in2s[1:]:
        in2li =  in2l.strip().split("\t")
        if in2li[0] in dictin1.keys():
            outcon.write(str(in2li[0])+"\t"+str(in2li[1])+"\t"+str(dictin1[in2li[0]])+"\n") 

一直用这几个用法,好无聊,没有长进

相关文章

网友评论

      本文标题:python14

      本文链接:https://www.haomeiwen.com/subject/ymoqbltx.html