<｜begin▁of▁sentence｜>### Instruction:
Imagine our company's network topology is currently mapped out using NetworkX, where the nodes represent connection points and the weighted edges correspond to the bandwidth cost or latency between these points. In our graph, for instance, the connection from node 1 to node 2 carries a weight of 7, indicating perhaps a cost metric, and the connection from node 2 to node 3 has a weight of 8. To facilitate the process of assessing our network infrastructure and possibly sharing this layout with our external partners for collaborative troubleshooting, we need to export this weighted graph into an edge list that retains the weight information. Subsequently, this edge list should be saved as a file—let's name it `network_topology_weighted.edgelist`—which would simplify any future analyses or audits. Could you prepare the network data in the described format and ensure the resulting file is named accordingly?
### Response:
import networkx as nx

G=nx.Graph()
G.add_edge(1, 2, weight=7)
G.add_edge(2, 3, weight=8)

# Write the weighted edge list to a text file
nx.write_weighted_edgelist(G, 'test.weighted.edgelist')
<|EOT|>
