Telnet versus telnetlib

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Mar 2 09:48:11 CET 2008


En Sun, 02 Mar 2008 02:09:14 -0200, Grant Edwards <grante at visi.com>  
escribi�:

> On 2008-03-01, Gabriel Genellina <gagsl-py2 at yahoo.com.ar> wrote:
>> En Fri, 29 Feb 2008 20:34:41 -0200, Sean Davis <seandavi at gmail.com>
>> escribió:
>>
>>> When I do an analogous process using telnetlib, I get no debug output,
>>> and most importantly, when I send the XML file to the host, I get no
>>> printed page.  Unfortunately, I do not have access to the host to do
>>> troubleshooting there, so I have to "feel" my way around.  Any
>>> suggestions on what might be going wrong?
>>>
>>> In [12]: tn.write("""<?xml version="1.0" encoding="UTF-8"?>
>>>    ....: <labels _FORMAT="C:\labels\anzick_primary_sample.lbl"
>>
>> \ is the quote character. You have to duplicate it "C:\\labels..." or  
>> use
>> a raw string r"""<?xml ... _FORMAT="C:\labels..."
>
> Or use a forward slash:
>
> "C:/labels/anzick_primary_sample.lbl"

I didn't menction that alternative because it generates a different  
string; the resulting xml document may or may not be equivalent.

-- 
Gabriel Genellina




More information about the Python-list mailing list