Re: Printing list/tuple elements on separate lines

2009-06-04 Thread Daniel Fetchinson
>> I have a large list of strings that I am unpacking >> and splitting, and I want each one to be on a new line. >> >> An example: >> >> recs = >> 'asdfasdfasdfasdfasdf','asdfasdfasdfasdfasdf','asdfasdfasdfasdfasdf' >> [(rec.split('f')) for rec in recs] >> >> output: >> >> [['asd', 'asd', 'asd', 'a

Re: Printing list/tuple elements on separate lines

2009-06-04 Thread John Yeung
On Jun 4, 8:37 pm, Johnny Chang wrote: > I have a large list of strings that I am unpacking > and splitting, and I want each one to be on a new line. > > An example: > > recs = > 'asdfasdfasdfasdfasdf','asdfasdfasdfasdfasdf','asdfasdfasdfasdfasdf' > [(rec.split('f')) for rec in recs] > > output: >

Re: Printing list/tuple elements on separate lines

2009-06-04 Thread Stephen Hansen
On Thu, Jun 4, 2009 at 5:37 PM, Johnny Chang wrote: > I have a large list of strings that I am unpacking and splitting, and > I want each one to be on a new line. Someone showed me how to do it > and I got it working, except it is not printing each on its own > separate line as his did, making i

Re: Printing list of dates starting today

2008-09-01 Thread Ari Makela
On 2008-09-01, Luka Djigas <[EMAIL PROTECTED]> wrote: > please, I need your help. I'm new to python, so I don't know if this > will seem like a stupid question to some of you ... There are several ways to do it. Have a look at the documentation of modules time and datetime. For this exact problem

Re: Printing list of dates starting today

2008-09-01 Thread Fredrik Lundh
Luka Djigas wrote: please, I need your help. I'm new to python, so I don't know if this will seem like a stupid question to some of you ... I have a need to write to a file (or just print on screen, that part doesn't matter at this point) a list of dates, starting today. For example: > 02.09.2

Re: printing list containing unicode string

2007-09-11 Thread Sion Arrowsmith
Xah Lee <[EMAIL PROTECTED]> wrote: > " It's very wasteful of space. In most texts, the majority of the >code points are less than 127, or less than 255, so a lot of space is >occupied by zero bytes. " > >Not true. In Asia, most chars has unicode number above 255. Considered >globally, *possibly*

Re: printing list containing unicode string

2007-09-11 Thread Xah Lee
J. Cliff Dyer wrote: " ...UCS-2, for example, is a fixed width, 2-byte encoding that can handle any unicode code point up to 0x, but cannot handle the 3 and 4 byte extension sets. " I was going to reply to say that this is a good point. But on my way i looked up wikipedia, http://en.wikipedia

Re: printing list containing unicode string

2007-09-10 Thread Marc 'BlackJack' Rintsch
On Mon, 10 Sep 2007 19:26:20 -0700, Xah Lee wrote: > ・ Many Internet standards are defined in terms of textual data, and > can't handle content with embedded zero bytes. > > Not sure what he mean by "can't handle content with embedded zero > bytes". Overall i think this sentence is silly, and h

Re: printing list containing unicode string

2007-09-10 Thread J. Cliff Dyer
Xah Lee wrote: > This post is about some notes and corrections to a online article > regarding unicod and python. > > -- > > by happenstance i was reading: > > Unicode HOWTO > http://www.amk.ca/python/howto/unicode > > Here's some problems i see: > > ・ No conspicuous authorship. (howeve

Re: printing list containing unicode string

2007-09-10 Thread Xah Lee
This post is about some notes and corrections to a online article regarding unicod and python. -- by happenstance i was reading: Unicode HOWTO http://www.amk.ca/python/howto/unicode Here's some problems i see: ・ No conspicuous authorship. (however, oddly, it has a conspicuous ackno

Re: printing list containing unicode string

2007-09-10 Thread Xah Lee
Google groups seems to be stripping my quotation markslately. Here's a retry to post my previous message. -- Xah Lee wrote: If i have a nested list, where the atoms are unicode strings, e.g. # -*- coding: utf-8 -*- ttt=[[u"→

Re: printing list containing unicode string

2007-09-10 Thread Xah Lee
On Sep 10, 8:12 am, Carsten Haese <[EMAIL PROTECTED]> wrote: Xah Lee wrote: If i have a nested list, where the atoms are unicode strings, e.g. # -*- coding: utf-8 -*- ttt=[[u"→",u"↑"], [u"αβγ"],...] print ttt how can i print it without getting the u'\u1234' notation? i.e. i want it print just l

Re: printing list containing unicode string

2007-09-10 Thread Carsten Haese
On Mon, 2007-09-10 at 06:59 -0700, Xah Lee wrote: > If i have a nested list, where the atoms are unicode strings, e.g. > > # -*- coding: utf-8 -*- > ttt=[[u"→",u"↑"], [u"αβγ"],...] > print ttt > > how can i print it without getting the u'\u1234' notation? > i.e. i want it print just like this: [[

Re: printing list, is this a bug?

2007-05-26 Thread Dan Bishop
On May 25, 3:55 pm, William Chang <[EMAIL PROTECTED]> wrote: > Is the different behavior between __repr__ and __str__ intentional > when it comes to printing lists? Basically I want to print out a list > with elements of my own class, but when I overwrite __str__, __str__ > doesn't get called but i

Re: printing list, is this a bug?

2007-05-25 Thread William Chang
oh okay. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: printing list, is this a bug?

2007-05-25 Thread Robert Kern
William Chang wrote: > Is the different behavior between __repr__ and __str__ intentional > when it comes to printing lists? Basically I want to print out a list > with elements of my own class, but when I overwrite __str__, __str__ > doesn't get called but if I overwrite __repr__, __repr__ will ge

Re: printing list

2006-05-07 Thread Dan Sommers
On Sun, 07 May 2006 18:16:22 -0400, Mel Wilson <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: >> compboy wrote: >> >>> How do you print elements of the list in one line? >>> >>> alist = [1, 2, 5, 10, 15] >>> >>> so it will be like this: >>> 1, 2, 5, 10, 15 >> >> >> >>> print ', '.join(alist) >

Re: printing list

2006-05-07 Thread Mel Wilson
Tim Chase wrote: > compboy wrote: > >> How do you print elements of the list in one line? >> >> alist = [1, 2, 5, 10, 15] >> >> so it will be like this: >> 1, 2, 5, 10, 15 > > > >>> print ', '.join(alist) > 1, 2, 5, 10, 15 ??? Python 2.4.2 (#1, Jan 23 2006, 21:24:54) [GCC 3.3.4] on linux2 Typ

Re: printing list

2006-05-07 Thread Tim Williams
On 7 May 2006 09:15:10 -0700, compboy <[EMAIL PROTECTED]> wrote: > How do you print elements of the list in one line? > > alist = [1, 2, 5, 10, 15] > > so it will be like this: > 1, 2, 5, 10, 15 > > because if I use this code > > for i in alist: > print i > > the result would be like this > > 1

Re: printing list

2006-05-07 Thread Raymond L. Buvel
compboy wrote: > How do you print elements of the list in one line? > > alist = [1, 2, 5, 10, 15] > > so it will be like this: > 1, 2, 5, 10, 15 > > because if I use this code > > for i in alist: > print i > > the result would be like this > > 1 > 2 > 5 > 10 > 15 > > Thanks. > There ar

Re: printing list

2006-05-07 Thread Tim Chase
compboy wrote: > How do you print elements of the list in one line? > > alist = [1, 2, 5, 10, 15] > > so it will be like this: > 1, 2, 5, 10, 15 >>> print ', '.join(alist) 1, 2, 5, 10, 15 -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: printing list

2006-05-07 Thread Gary Herron
compboy wrote: >How do you print elements of the list in one line? > >alist = [1, 2, 5, 10, 15] > >so it will be like this: >1, 2, 5, 10, 15 > >because if I use this code > >for i in alist: >print i > >the result would be like this > >1 >2 >5 >10 >15 > >Thanks. > > Well, first, if you just