View Single Post
  #3  
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:
Code:
results_path = os.path.join(os.path.expanduser("~"), "lica_info.txt")
f = open(results_path, 'w')
    f.write(final_results,)
    f.close()
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
Code:
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.

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

	crt.Clipboard.Text = text

main()
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