<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edges [('A', 'B'), ('B', 'C'), ('C', 'A'), ('D', 'E')], can you generate the weakly connected components using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()

# Add edges to the graph
G.add_edge('A', 'B')
G.add_edge('B', 'C')
G.add_edge('C', 'A')
G.add_edge('D', 'E')

# Generate weakly connected components
components = list(nx.weakly_connected_components(G))

# Output the components
print('Weakly connected components:', components)
<|EOT|>
