Python Forum

Full Version: How to create a New line in a Text block in Blender software using Python 3.7?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
This question is relevant to Python 3.7 used in Blender software(C++/Python).
Blender VideoEditor's "Text Block" only accepts 1 line strings.
Using the "EnterKey" for adding another line doesn't work.
When a newline character "\n" is used instead, the additional strings automatically gets concatenated at the end of the line instead of being shown on a newline .

Example 1
  • Text Input - line1\nline2
  • Screen Output - line1\nline2

Example 2
  • Text Input - line1+"\n"+line2
  • Screen Output - line1+"\n"+line2

On checking in the terminal, Blender shows the text in an escaped format.
Terminal
  • Output Example1 - line1\\nline2
  • Output Example1 - line1+\"\\n\"+line2

Please let me know ,if there is any way to add a newline .Thanks.
(Would have posted the image,but couldn't find a place to upload)