Simple script but I cant figure it out...

Hi. I am having a hard time figuring out which is the best way to do this… I know its simple but where the mesh system ends and Bmesh starts still elude me.

I would like to build a copy of the selected mesh with only the edges, and none of them connected.
So: For each edge in mesh -> add new edge to new mesh -> copy mesh back to original object.

My xcript is adjusted from an online example:

//START

import bpy
import bmesh

print (" – new --")
print (bpy.context.object)

Get the active mesh

me = bpy.context.object.data

Get a BMesh representation

bm = bmesh.new() # create an empty BMesh
nbm = bmesh.new()

bm.from_mesh(me) # fill it in from a Mesh

Modify the BMesh, can do anything here…

for e in bm.edges:
#add the edge e to the new mesh nbm
#This I dont know how to…

Finish up, write the new bmesh back to the mesh

bm.to_mesh(me)
me.update()

// END

Thank you.

import bpy, bmesh

me = bpy.context.object.data
bm = bmesh.new()
bm.from_mesh(me)

bm2 = bmesh.new()
for edge in bm.edges:
    v1 = bm2.verts.new(edge.verts[0].co)
    v2 = bm2.verts.new(edge.verts[1].co)
    bm2.edges.new((v1, v2), edge)
    
bm2.to_mesh(me)
me.update()

Thanks CoDEmanX. You are apparently my life line when it comes to python in blender!