John Machin a écrit :
(snip)
> ... or was that a rhetorical question?
It was.
--
http://mail.python.org/mailman/listinfo/python-list
Tim Roberts a écrit :
> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
>
>
>>Sion Arrowsmith a écrit :
>>
(snip)
>>>"more flexible"? More convenient, yes. More powerful, maybe. But I
>>>don't see more flexible. Everything print can to stdout.write() can
>>>do. The reverse isn't true. eg (this app
On 3/06/2006 9:47 AM, Bruno Desthuilliers wrote:
>
> Now, given:
>
> bird = "parrot"
> beautiful = "dead"
>
> How would you do the following with f.write() ?
>
> print "this", bird, "is", beautiful
>
> (without using string formating, of course...)
Like this:
f.write((' '.join(str(x)
Tim Roberts <[EMAIL PROTECTED]> wrote:
> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
>
> >Sion Arrowsmith a écrit :
> >> A.M <[EMAIL PROTECTED]> wrote:
> >>
> >>>I found print much more flexible that write method.
> >>
> >> "more flexible"? More convenient, yes. More powerful, maybe. But I
>
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
>Sion Arrowsmith a écrit :
>> A.M <[EMAIL PROTECTED]> wrote:
>>
>>>I found print much more flexible that write method.
>>
>> "more flexible"? More convenient, yes. More powerful, maybe. But I
>> don't see more flexible. Everything print can to stdou
Sion Arrowsmith a écrit :
> A.M <[EMAIL PROTECTED]> wrote:
>
>>I found print much more flexible that write method.
>
>
> "more flexible"? More convenient, yes. More powerful, maybe. But I
> don't see more flexible. Everything print can to stdout.write() can
> do. The reverse isn't true. eg (this
A.M <[EMAIL PROTECTED]> wrote:
>I found print much more flexible that write method.
"more flexible"? More convenient, yes. More powerful, maybe. But I
don't see more flexible. Everything print can to stdout.write() can
do. The reverse isn't true. eg (this appears to be a FAQ on this
group, althoug
Yes, it saved my time big time.
Thank you Bruno.
I use the print >>>file to generate HTML files. print is very flexible and
nice.
The dictionary formatting that Brunto said is awesome!
Thanks again,
Alan
"Jon Clements" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Di
I meant 'trailing': not leading.
mea culpa.
Jon.
Jon Clements wrote:
> Didn't know of the >> syntax: lovely to know about it Bruno - thank
> you.
>
> To the OP - I find the print statement useful for something like:
> print 'this','is','a','test'
> >>> 'this is a test'
> (with implicit newline
Didn't know of the >> syntax: lovely to know about it Bruno - thank
you.
To the OP - I find the print statement useful for something like:
print 'this','is','a','test'
>>> 'this is a test'
(with implicit newline and implicit spacing between parameters)
If you want more control (more flexibility,
A.M a écrit :
> Hi,
>
>
> I found print much more flexible that write method. Can I use print instead
> of file.write method?
>
f = open("/path/to/file")
print >> f, "this is my %s message" % "first"
f.close()
To print to stderr:
import sys
print >> sys.stderr, "oops"
FWIW, you and use stri
Hi,
I found print much more flexible that write method. Can I use print instead
of file.write method?
Thank you,
Alan
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo