Class point is defined as (there are also some methods, atributes, and stuff in it, but this is minimal part):
class point():
def ___init___(self, x, y):
You have added a node
and as such, you can examine the nodes
which is a set-like view. Quoting from the docs:
These are set-like views of the nodes, edges, neighbors (adjacencies), and degrees of nodes in a graph. They offer a continually updated read-only view into the graph structure.
Do for example:
mynodes = list(G.nodes())
print(mynodes)
You should be now able to also do:
mynode = mynodes[0] # because we have converted the set-like view to a list
See the tutorial: https://networkx.github.io/documentation/stable/tutorial.html