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.0699
On Fri, Jan 15, 2010 at 4:13 PM, Anand Chitipothu wrote:
> On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose
> 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 :)
>
On Fri, Jan 15, 2010 at 4:13 PM, Anand Chitipothu wrote:
> On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose
> 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 :)
>
On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose 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 simplejson.loads instead of
On Fri, Jan 15, 2010 at 4:03 PM, Noufal Ibrahim wrote:
> On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose >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 :)
On Fri, Jan 15, 2010 at 4:00 PM, Baishampayan Ghose 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 :)
>
Given that the OPs data is fixed, eval is okay. :)
Otherwise, it c
> 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
BangPyp
On Fri, Jan 15, 2010 at 2:40 PM, Anand Balachandran Pillai
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 my hands and
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:17 PM, Noufal Ibrahim wrote:
> On Fri, Jan 15, 2010 at 1:04 PM, Dhananjay Nene >wrote:
>
> > 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
On Fri, Jan 15, 2010 at 1:04 PM, Dhananjay Nene wrote:
> 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 n
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
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" =>
13 matches
Mail list logo