[Tutor] Re: Help with AppendText Syntax

Lee Harr missive at hotmail.com
Sun Dec 21 17:25:53 EST 2003


>I tried the following but still no luck.
>
>self.tester.AppendText("Code returned is:" field1)
>
>The error is still invalid syntax. I think I am missing
>something to prefix "field1" but do not know what.
>


Ah. Ok, I guess you can only do that with string literals ...


>>>"Code returned is:" "code"
'Code returned is:code'

>>>field1 = 'code'
>>>"Code returned is:" field1
  File "<stdin>", line 1
    "Code returned is:" field1
                             ^
SyntaxError: invalid syntax


So, probably what you want is ...

self.tester.AppendText("Code returned is: %s" % field1)

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus




More information about the Tutor mailing list