On Fri, Jan 15, 2010 at 1:04 PM, Dhananjay Nene dhananjay.n...@gmail.comwrote:
This seems to be an output of print_r of PHP. If you have a flexibility,
try
to have the PHP code output the data into a language neutral format (eg
json, yaml, xml etc.) and then parse it in python using the
On Friday 15 Jan 2010 12:01:56 pm Eknath Venkataramani wrote:
and I need to extract confident , ashahvasahta from the first
record, consumers, upabhaokahtaa from the second record...
i.e. word in english and the first word in the probable-translations
#!/usr/bin/python
words =
On Fri, Jan 15, 2010 at 2:40 PM, Anand Balachandran Pillai
abpil...@gmail.com wrote:
# Now, count and trans are not strings in
# data, so Python will complain, hence we
# define these as strings with same name!
count, trans = 'count','trans'
Clever, that. I got to there, threw up
It is a clever hack, taking advantage of the nature of the data. But
it is far more faster than the other approaches posted here.
I thought eval was evil :)
Regards,
BG
--
Baishampayan Ghose
b.ghose at gmail.com
___
BangPypers mailing list
On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose b.gh...@gmail.com wrote:
It is a clever hack, taking advantage of the nature of the data. But
it is far more faster than the other approaches posted here.
I thought eval was evil :)
The date looks like valid json. You can use
On Fri, Jan 15, 2010 at 4:13 PM, Anand Chitipothu anandol...@gmail.comwrote:
On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose b.gh...@gmail.com
wrote:
It is a clever hack, taking advantage of the nature of the data. But
it is far more faster than the other approaches posted here.
I
On Fri, Jan 15, 2010 at 4:13 PM, Anand Chitipothu anandol...@gmail.comwrote:
On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose b.gh...@gmail.com
wrote:
It is a clever hack, taking advantage of the nature of the data. But
it is far more faster than the other approaches posted here.
I
On Fri, Jan 15, 2010 at 12:01 PM, Eknath Venkataramani
eknath.i...@gmail.com wrote:
I have a txt file in the following format:
[code]
confident = {
count = 4,
trans = {
ashahvasahta = 0.74918568,
atahmavaishahvaasa = 0.09095465,
pahraaram\.nbha = 0.06990729,
mailatae
I have a txt file in the following format:
[code]
confident = {
count = 4,
trans = {
ashahvasahta = 0.74918568,
atahmavaishahvaasa = 0.09095465,
pahraaram\.nbha = 0.06990729,
mailatae = 0.02856427,
utanai = 0.01929341,
anaa = 0.01578552,
This seems to be an output of print_r of PHP. If you have a flexibility, try
to have the PHP code output the data into a language neutral format (eg
json, yaml, xml etc.) and then parse it in python using the appropriate
parser. If not you may have to write a custom parser. I did google to find
if
10 matches
Mail list logo