Orientation perpendicular to Edge I have got a mesh that's converted from curve. It has only edges. I need to successively orient one of the objects in the scene to the direction pointed by the blue arrow in the illustration above (perpendicular to the edge and in the direction of the normal of the hypothetical face, formed by the planar vertices). How do I calculate the orientation using python?
a simple cross product solves your problem:

\begin{equation}
\hat{z}: the \space unit \space vector \space along \space z \space axis\\
\vec{e_\perp}:the \space vector \space perpendicular \space to \space edge \space and \space the \space z \space axis\\
\vec{p_1}:position \space of \space first \space vertex \space in \space world \space coordinates\\
\vec{p_2}:position \space of \space second \space vertex \space in \space world \space coordinates\\
\vec{e_1}:vector \space along \space edge\\
\vec{p_2} - \vec{p_1} = \vec{e_1}\\
\hat{z} \times \vec{e_1} = \vec{e_\perp}\\
\vec{e_1} \times \vec{e_\perp} = \vec{desiredDirection}
\end{equation}

you can use mathutils's Vector library to do this.