Python command in a Python program including filenames

I wrote a super complex two lines of code a while ago.

PyCmd = "\"import vtk; vtk.fundi2VTK(\'" + SurfaceFile + "\',\'" + FundiFile + "\');  \""
os.system("python -c " + PyCmd + '> '+ FundiFile  +'.inflated.vtk')

Be careful. Don't drive yourself nuts by so many pairs of quotation marks.

No comments: