Making a star tetrahedron in python script
Scripting probably isn't a good option. That particular script just creates a bunch of cylinder objects and aligns them to approximate a tetrahedron. This isn't good topology and is most definitely not 3d-printable. To create a script that would actually do that, you would probably need to use the bmesh api. 

This here isn't scripting, but is an easy way to model a star tetrahedron than programming it.

Step 1: Add a cone. Set the vertices to 3 and the the depth to sqrt(2) (Blender will automatically parse it). 



Step 2: Go into Edit Mode, select everything, and hit W > Subdivide. Select all of the center faces and click Extrude Individual in the sidebar, then hit Enter without moving the mouse.



Step 3: Set the Pivot Center to Individual Origins.



Step 4: Press S, then 0, then Enter to collapse the faces down to vertices.



Step 5: In the sidebar, press Remove Doubles.

Step 6: Change the Pivot Center back to Median Point.

Step 7: With just the center vertices selected, press S, then 3, then Enter to move out the points. 



If you want to make it a wireframe like your reference image, you can use a wireframe modifier:



And you can smooth it out with some tweaking of settings and some SubSurf modifiers.