Hi All,
I have two dictionaries:
somex:{'unit':00, type:'processing'}
somey:{'comment':'fair', 'code':'aaa'}
somey:{'comment':'good', 'code':bbb'}
somey:{'comment':'excellent', 'code':'ccc'}
now i would like to write this to a file in the following format(unit,
code
;)
f.writelines("%s" %some['name'])
f.writelines("credit:")
f.writelines("%s" % amount)
but i see an empty file opened,,,
kavitha
Simon Brunning <[EMAIL PROTECTED]> wrote:
On 3/8/07, kavitha thankaian wrote
Hi,
I have 'n' number of dictionaries with the same name but different values
( DorC means debit or credit)
some={'DorC':'D', 'amount':200,'name':'xxx'}
some={'DorC':'C', 'amount':200,'name':'xxx'}
some={'DorC':'D', 'amount':300,'name':'yyy'}
some={'DorC':'C', 'amount':500,
thanks,,,
i tried another way and it works,,,
f.writelines(','.join([('\"%s\"' % some[field]) for field in field_order]))
thanks a lot,,,
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
En Wed, 28 Feb 2007 08:34:29 -0300, kavitha thankaian
writelines('\"%s\",' % someprt[field] )
do you have an idea now how should it look like???
Mikael Olofsson <[EMAIL PROTECTED]> wrote:
kavitha thankaian wrote:
> my script writes a dictionary to a file.but i need only the values
> from the
tmpstr.strip(","))>strings seperated by comma
-----------
Thanks
sanket
kavitha thankaian wrote:
> ok,,,
> my script writes a dictionary to a file.but i need only the values
> from the dictionary which should be sepearted by a comma,,,
telines('\%s\,' % value )>strings seperated by comma
when i execute the above code,my test.txt file has the following:
a,b,c,d,
now i need to delete the comma at the end,,,this is my problem,,,
kavitha
Mikael Olofsson <[EMAIL PROTECTED]
i run the above code,i get an error"bad file descriptor"
thanks,,
kavitha
Mohammad Tayseer <[EMAIL PROTECTED]> wrote:
kavitha thankaian <[EMAIL PROTECTED]> wrote:
> and i need the output also in the same input.txt
jus
ill remove the ',' char from the beginning & end of the string, not
the middle. empty strip() will remove whitespaces from the beginning & end of
the string
I hope this solves your problem
kavitha thankaian <[EMAIL PROTECTED]> wrote:hi
i would like to have the ou
hi,
i have a file which has the contents as follows:
a,b,c,d,
a1,b1,c1,d1,
a2,b2,c2,d2,
i would like to delete all the trailing commas,,
if someoneknows pls help me,,
kavitha
-
Heres a new way to f
a,b,c,d,
i would like to delete the trailing comma at the end,,,
if someone knows pls write to me,,,
kavitha
Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Mon, 19 Feb 2007 08:02:29
-0300, kavitha thankaian
escribió:
> Hi,
> i have a file test.txt and it contai
Hi,
i have a file test.txt and it contains a list of strings say,,,
"a","b","c","d","a1","b1","c1","d1","a2","b2","c2","d2",
i would like to write the file as
"a","b","c","d"
"a1","b1","c1","d1
"a2","b2","c2","d2"
and would like to delete the comma at the end.
Hi
i have a list as follows
list="a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,
I would like to print as
a1,b1,c1,d1,
a2,b2,c2,d2,
a3,b3,c3,d3,
and then i would like to delete the comma at the end,,say like,,
a1,b1,c1,d1
a2,b2,c2,d2
a3,b3,c3,d3
(its always
,,,
Kavitha
Eugene Antimirov <[EMAIL PROTECTED]> wrote:
kavitha thankaian wrote:
> Hi,
>
> i wrote a simple script (which follows) to insert a table in the
> database.i could execute this query and get the result in python
> shell.but when i open "my sql enterprise m
Hi Eugene,
I tried with conn.commit() as well,,but doesnt seem to work.
Also i cannot even view the existing tables via python script.For example,,,i
have manually added a customer table in my database.but if i execute the query,
select * from customer,,,i get the following error:
m
Hi,
i wrote a simple script (which follows) to insert a table in the database.i
could execute this query and get the result in python shell.but when i open "my
sql enterprise manager" i couldnt find the table"animals".it would be so kind
of you if someone could help me,,,
import
16 matches
Mail list logo