View Single Post
Old 08-25-2016, 04:03 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
Originally Posted by rleon View Post
hmmm I checked that ..

No extra characters.
The extra char(s) are there, you just won't be able to see them since they're non-printing.

This should demonstrate for you what's going on:

with open('/Users/rleon/Documents/hosts.5') as hosts_:
    for host in hosts_:
        crt.Dialog.MessageBox(host.replace("\r", "[CR]").replace("\n", "[LF]"))
The for-loop in python doesn't strip all end-of-line chars for you, so you have to be aware to remove them from variables so that you can use them in a command line. If the host variable has an LF or a CR in it, it will surely affect the way any command that you craft using the host variable.

Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote