Re: print format

2009-12-15 Thread Dave Angel
Gabriel Genellina wrote: En Tue, 15 Dec 2009 00:28:11 -0300, Dave Angel escribió: mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah i

Re: print format

2009-12-14 Thread Gabriel Genellina
En Tue, 15 Dec 2009 00:28:11 -0300, Dave Angel escribió: mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, b

Re: print format

2009-12-14 Thread Dave Angel
mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, but isn't format for string formatting? Thanks, Matti

Re: print format

2009-12-14 Thread MRAB
mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, but isn't format for string formatting? That's because it's the

print format

2009-12-14 Thread mattia
Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? >>> print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, but isn't format for string formatting? Thanks, Mattia -- http://mail.python.o