On Tuesday, November 12, 2002, at 08:15 PM, [EMAIL PROTECTED] wrote:
A literal string in a Python program doesn't do anything, just like with most languages. I think that the OP was referring to the Python interactive prompt, wherein a name by itself is evaluated (and a literal string evaluates to a literal string). Here is an example:On Tue, 12 Nov 2002, at 10:08pm, [EMAIL PROTECTED] wrote:Python hacker'Hello, world.'Transcript of my shell session: $ cat > hw.py 'Hello, world.' ^D $ python hw.py $ What did I do wrong?
wintermute:~$ python
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 'hello world' # string literal all by itself
'hello world' # evaluated
>>> hw = 'hello world'
>>> hw # variable name all by itself
'hello world' # evaluated
>>>
But you're right, the simple presence of either a literal string or a name won't do anything in an executed python script unless you feed it to print() or something.
Erik
--
Erik Price (zombies roam)
email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
_______________________________________________
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss