[BangPypers] python split

Sibtey Mehdi sibteym at infotechsw.com
Tue Oct 21 12:49:18 CEST 2008


Try this

 

Sep = 50

l1 = [textString[a:a+sep] for a in range(0, len(textString), sep)]

 

Sibtey

  _____  

From: bangpypers-bounces+sibteym=infotechsw.com at python.org
[mailto:bangpypers-bounces+sibteym=infotechsw.com at python.org] On Behalf Of
VIJAY KUMAR
Sent: Tuesday, October 21, 2008 4:03 PM
To: Bangalore Python Users Group - India
Subject: [BangPypers] python split

 

Hi ,
     Is there a way to split text  like below example
 
textString='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaab'

after every 50 character .
Can some one help me here

 

with regard's

vijay kumar bang

 





  _____  


Download prohibited? No problem. CHAT
<http://in.rd.yahoo.com/tagline_webmessenger_1/*http:/in.webmessenger.yahoo.
com/>  from any browser, without download.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20081021/cbf63c71/attachment.htm>


More information about the BangPypers mailing list