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
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
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
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
> 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
>
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@
> >
> > 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
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
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: