Re: easy string formating question

2006-08-11 Thread Slawomir Nowaczyk
On Thu, 10 Aug 2006 17:28:59 -0700 Simon Forman <[EMAIL PROTECTED]> wrote: #> There is a better way to check for exhausted StringIO (Note that #> "input" is a python built-in and should not be used for a variable #> name): Right, thanks for pointing it out. #> import StringIO #> s = '1234567890a

Re: easy string formating question

2006-08-10 Thread Simon Forman
Slawomir Nowaczyk wrote: > On Thu, 10 Aug 2006 11:39:41 -0700 > f pemberton <[EMAIL PROTECTED]> wrote: > > #> I have kind of an interesting string, it looks like a couple hundred > #> letters bunched together with no spaces. Anyway, i'm trying to put a > #> "?" and a (\n) newline after every 100t

Re: easy string formating question

2006-08-10 Thread Slawomir Nowaczyk
On Thu, 10 Aug 2006 11:39:41 -0700 f pemberton <[EMAIL PROTECTED]> wrote: #> I have kind of an interesting string, it looks like a couple hundred #> letters bunched together with no spaces. Anyway, i'm trying to put a #> "?" and a (\n) newline after every 100th character of the string and #> the

Re: easy string formating question

2006-08-10 Thread [EMAIL PROTECTED]
here's a simple way numChar = 10 testText="akfldjliugflkjlsuagjlfnflgj" for c in xrange(0,len(testText),numChar): print testText[c,c+numChar] for slightly better performance you should probably do numChar = 10 testText="akfldjliugflkjlsuagjlfnflgj" lenText = len(testText) for c in xrange(0,le

Re: easy string formating question

2006-08-10 Thread Tim Chase
> I have kind of an interesting string, it looks like a couple hundred > letters bunched together with no spaces. Anyway, i'm trying to put a > "?" and a (\n) newline after every 100th character of the string and > then write that string to a file. How would I go about doing that? Any > help woul

easy string formating question

2006-08-10 Thread f pemberton
I have kind of an interesting string, it looks like a couple hundred letters bunched together with no spaces. Anyway, i'm trying to put a "?" and a (\n) newline after every 100th character of the string and then write that string to a file. How would I go about doing that? Any help would be much