questions? wrote:
Are there similar function to sprintf in C?
Meaning to print in a buffer? It's not necessary...
Remember that all the ways that prints on files, actually does not need
to print into *actual* files, but they can print into file-like objects
(see StringIO, or mmap, for
On 2007-01-22, questions? [EMAIL PROTECTED] wrote:
Are there any sprintf in Python?
I know you can print to files(or redefine sys.stout) and later open the
file content.
Are there similar function to sprintf in C?
No, but you can compose a similar function very easily.
def sprintf(format
questions? [EMAIL PROTECTED] writes:
Are there any sprintf in Python?
I know you can print to files(or redefine sys.stout) and later open the
file content.
Are you looking for something like this?
http://norvig.com/python-iaq.html
or
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe
Are there any sprintf in Python?
I know you can print to files(or redefine sys.stout) and later open the
file content.
Are there similar function to sprintf in C?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
questions? [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
Are there any sprintf in Python?
I know you can print to files(or redefine sys.stout) and later
open the file content.
Are there similar function to sprintf in C?
Something like this?
x = 9
vbl = One digit: %d, four digits
Are there any sprintf in Python?
Refer module StringIO - just like file input/output operations.
cStringIO is another module (faster)
Quick intro:
from StringIO import StringIO
s = StringIO()
s.write('hello')
s.seek(0)
print s.read()
-N
--
http://mail.python.org/mailman/listinfo/python