View Single Post
Old 08-17-2016, 05:41 AM
vysh vysh is offline
Registered User
Join Date: Oct 2014
Posts: 40
Thanks for the reply.

I have found out that the extra CRs get added here:
results_path = os.path.join(os.path.expanduser("~"), "lica_info.txt")
f = open(results_path, 'w')
Immediately before that if I crt.Dialog.MessageBox(final_results) everything looks fine, no extra CRs. But in the file it writes "\r\r\n". I am unsure why :-/
For now I just implemented a dirty workaround with
f.write(final_results.replace('\r', ''))
. It strips all '\r's from the string and Windows transforms single \n's to \r\n and all looks good, but it doesn't solve the problem itself.
While I was looking into my newline issues I decided to additionally copy everything to Clipboard. But I immediately ran into another issue.

def main():
	text = "First line.\nSecond line\n\nFourth line."

	crt.Clipboard.Text = text

It will not convert \n to \r\n when run in SecureCRT 8.0.2 for Windows. Is this normal?

Last edited by vysh; 08-17-2016 at 09:15 AM.
Reply With Quote