Special Characters

Sick Monkey sickcodemonkey at gmail.com
Tue Feb 27 20:56:15 EST 2007


Sorry guys.  It has been a long day today.  There is no issues when dealing
with "#" in variables.  I found out that when I was reading the file, there
were additional blank spaces being appended to the value.

To correct the issue, I just had to dp
    varName = msInfo[0].strip()
    finName = varName.strip()


On 2/27/07, Sick Monkey <sickcodemonkey at gmail.com> wrote:
>
> I have a quick question about handling values with special characters.
>
> Lets say I have a file which contains:
> ==================================
>    blah#blah
> ==================================
> Here is what I have for my code:
>    f6 = open(fileAttached)
>    msInfo = f6.readlines(); f6.close()
>    varName = msInfo[0]
>    ....
>    smtp.login(uname,varName)
>    ...
> ==================================
> I am trying to connect to a mailserver, and it keeps failing.  My guess is
> that the "#" sign messing up.  Is there anyway to encode that character?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070227/2d74b05c/attachment.html>


More information about the Python-list mailing list