Re: [BangPypers] How should I do it?

2010-01-14 Thread Dhananjay Nene
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 one existed, but couldn't easily locate one.

Dhananjay

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" => 0.02856427,
>   "utanai" => 0.01929341,
> "anaa" => 0.01578552,
> "uthaanae" => 0.01403157,
> "jaitanae" => 0.01227762,
>},
> },
> "consumers" => {
>  count => 4,
>  trans => {
>"upabhaokahtaa" => 0.75144362,
>"upabhaokahtaaom\.n" => 0.12980166,
>"sauda\�\�\�dha" => 0.11875471,
>},
> },
> "a" => {
>  count => 1164,
>  trans => {
>  "eka" => 0.14900491,
>   "kaisai" => 0.08834675,
> "haai" => 0.06774697,
> "kaoi" => 0.05394308,
>  "kai" => 0.04981982,
> "\(none\)" => 0.04400085,
>  "kaa" => 0.03726579,
>  "kae" => 0.03446450,
>},
> },
> [/code]
>
> 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"
>
> Thanks is advance
> Eknath
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


[BangPypers] How should I do it?

2010-01-14 Thread Eknath Venkataramani
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,
 "uthaanae" => 0.01403157,
 "jaitanae" => 0.01227762,
},
},
"consumers" => {
  count => 4,
  trans => {
"upabhaokahtaa" => 0.75144362,
"upabhaokahtaaom\.n" => 0.12980166,
"sauda\�\�\�dha" => 0.11875471,
},
},
"a" => {
  count => 1164,
  trans => {
  "eka" => 0.14900491,
   "kaisai" => 0.08834675,
 "haai" => 0.06774697,
 "kaoi" => 0.05394308,
  "kai" => 0.04981982,
 "\(none\)" => 0.04400085,
  "kaa" => 0.03726579,
  "kae" => 0.03446450,
},
},
[/code]

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"

Thanks is advance
Eknath
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Power management/consumption control module

2010-01-14 Thread Noufal Ibrahim
On Thu, Jan 14, 2010 at 5:04 PM, Anirudh Asokan wrote:

> so what we are basically saying is that there is no way one can
> interact/read with APCI using python???
>

I don't recollect anyone saying that in the thread so far. Try
http://tinyurl.com/yl58568


-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Power management/consumption control module

2010-01-14 Thread Anirudh Asokan
so what we are basically saying is that there is no way one can
interact/read with APCI using python???

-- 
Cheers,
Anirudh Asokan
www.anirudh.ind.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers