Drawing a line using Python script I would like to draw a simple line using Python script code.
I would like to draw the line from (0,0,0) to (0,0,1)

My philosophy (from what I've seen on the net) is:

Draw a mesh plane (center at (0,0,0))
Select and delete 3 of the 4 vertices (Edit Mode)
Snap (move) the remaining vertex to the center of the plane (original placement point)
 - snap cursor to center
 - select and snap remaining vertex to cursor (now at the center)
Extrude the current vertex to (0,0,1)

I come from a CAD world, so this seems complicated for a simple object like a line, but I'm willing to adapt.

My general task is to draw "stick figures" using lines (between named points).
Being able to "name" the points would be a plus, so I can draw new lines
starting from those named points when needed.
some good reference: adding geometry

note that you must be in editmode (EDIT: to go to edit mode, create a mesh, select it with right-click, and then hit "tab"), and remove doubles after run the script:

import bpy, bmesh

obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me)

v1 = bm.verts.new((2.0, 2.0, 2.0))
v2 = bm.verts.new((-2.0, 2.0, 2.0))
v3 = bm.verts.new((-2.0, -2.0, 2.0))


bm.edges.new((v1, v2))
bm.edges.new((v2, v3))

bmesh.update_edit_mesh(obj.data)


if you have the point list, may be you can apply some loops