123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import networkx as nx
- import matplotlib.pyplot as plt
- def backfile_cc():
-
-
-
- with open("data/KnowledgeGraph/sample6.txt") as f:
- G = nx.Graph()
- for line in f:
- line = line.strip('\n')
-
- file, domain = line.split(',')
- G.add_edge(file, domain)
- nx.draw(G, with_labels=True, node_size=600)
- plt.show()
- def domain_contact():
-
-
-
- with open("data/KnowledgeGraph/sample5.txt") as f:
- G = nx.Graph()
- for line in f:
- line = line.strip('\n')
-
- email, domain, ip = line.split(',')
- G.add_edge(email, domain)
- G.add_edge(domain, ip)
- nx.draw(G, with_labels=True, node_size=600)
- plt.show()
- def main():
- backfile_cc()
- domain_contact()
- if __name__ == "__main__":
- main()
|