recently i´ve encountered some problems pasting code from Rhino’s built in python editor. The code looks ok in the preview pane but once i clicked on send, it somehow is wrangled and a few line breaks are not preserved. So here is a python test, the code is straight from the built in python editor, the code contains blank lines as well:
import rhinoscriptsyntax as rs import os def SaveAsRhinoFile(name="Default.3dm"): filename = name folder = "D:/Temp/" path = os.path.abspath(folder + filename) cmd = "_-SaveAs " + chr(34) + path + chr(34) rs.Command(cmd, True) if __name__=="__main__": SaveAsRhinoFile("MyTestFileName.3dm")
To make shure that the line breaks are there, here is a screengrab of another editor which is able to display linebreaks:
Along with this i would like to express one wish to make copying code examples easier. eg. discourse might provide a button under code examples to copy the content to the clipboard. I´ve found that selecting it and manually copying the code causes unexpected intendation once pasted into a local python editor.