May-23-2024, 11:27 PM
(This post was last modified: May-24-2024, 05:13 AM by Gribouillis.)
Hey guys would anyone be able to look over this for a buddy of mine and see why this is not working. I’m not familiar with really any python.
From what I understand they have an account who has to write 80 paragraphs for their thing and then need a break. Whenever they enter it it gets rid of the paragraphs. So he had the idea to come up with this to fix that problem.
This might be super simple,
Thank you very much!
From what I understand they have an account who has to write 80 paragraphs for their thing and then need a break. Whenever they enter it it gets rid of the paragraphs. So he had the idea to come up with this to fix that problem.
This might be super simple,
Thank you very much!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
def insert_line_breaks(): editor.beginUndoAction() pos = 80 while pos < editor.getTextLength(): editor.insertText(pos, '\n' ) pos + = 81 # Move to the next position after the newly inserted line break editor.endUndoAction() insert_line_breaks() |
Gribouillis write May-24-2024, 05:13 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.