Re: [Tutor] gtk.TreeView displays all right on Windows, but can't see the values on Ubuntu

2012-04-25 Thread Timo
Op 25-04-12 06:41, Lion Chen schreef: Hi, All, Hi, please fix your formatting, the indentation is a big mess and makes it impossible to read. You should also ask your question on the PyGTK mailing list, not here. first thanks the people who gave helps to me, :) now i encountered another que

[Tutor] passing results between functions

2012-04-25 Thread Gerhardus Geldenhuis
Hi I wrote two functions which does different manipulations on text files. To start out with I passed the filename as a parameter and each function opened the file and saved it. I then realized I would need to do that twice if I wanted to use both my functions on the same file. I the modified the

Re: [Tutor] passing results between functions

2012-04-25 Thread Dave Angel
On 04/25/2012 05:36 AM, Gerhardus Geldenhuis wrote: > Hi > I wrote two functions which does different manipulations on text files. > > To start out with I passed the filename as a parameter and each function > opened the file and saved it. > > I then realized I would need to do that twice Do what

[Tutor] creating a regularly placed fields in a line

2012-04-25 Thread Bala subramanian
Friends, I wrote a small piece of code (given below). The aim is to take each line in a file, split the fields, replace the first four fields and then write the new lines in a output file. The input and output are given in the attached file. The output contains fields which are irregularly placed d

Re: [Tutor] creating a regularly placed fields in a line

2012-04-25 Thread Prasad, Ramit
> I wrote a small piece of code (given below). The aim is to take each line > in a file, split the fields, replace the first four fields and then write > the new lines in a output file. The input and output are given in the > attached file. The output contains fields which are irregularly placed >

Re: [Tutor] creating a regularly placed fields in a line

2012-04-25 Thread Mark Lawrence
On 25/04/2012 16:57, Prasad, Ramit wrote: Not really sure how to do the equivalent with % substitution. Ramit See http://docs.python.org/library/stdtypes.html#string-formatting-operations -- Cheers. Mark Lawrence. ___ Tutor maillist - Tutor@

Re: [Tutor] creating a regularly placed fields in a line

2012-04-25 Thread Prasad, Ramit
> > > > Not really sure how to do the equivalent with % substitution. > > > > See > http://docs.python.org/library/stdtypes.html#string-formatting-operations > > Mark Lawrence. Thanks Mark. Based on that, I find .format more intuitive (especially for alignment) than % substitution. Useful to k

Re: [Tutor] passing results between functions

2012-04-25 Thread Alan Gauld
On 25/04/12 10:36, Gerhardus Geldenhuis wrote: Hi I wrote two functions which does different manipulations on text files. To start out with I passed the filename as a parameter and each function opened the file and saved it. I assume you mean it did some processing on the file data and then wr

Re: [Tutor] creating a regularly placed fields in a line

2012-04-25 Thread Alan Gauld
On 25/04/12 16:17, Bala subramanian wrote: placed depending up on the size of the field. I am thinking to fix the size of each field. with open('tmp') as tp: for line in tp: ... bond.write(' %s\t%s\t%s\t%s\t%s\n' % (p1,p2,p3,p4,new) ) Add your widths to the format string: