Dear group,
In my XML file some attributes have text within an
element. I want to get that text. How can I do that.
I looked into ElementTree -bits and pieces: and there
is a small function.
>>> def gettext(elem):
... text = elem.text or ""
... for e in elem:
... text += get
Dear drs. Yoo and johnson,
Thank you very much for your help. I successully
parsed my GO annotation from all 16,000 files.
thanks again for your kind help
--- Danny Yoo <[EMAIL PROTECTED]> wrote:
>
> > >>> for m in mydata.findall('//functions'):
> > print m.get('molecular_class').text
>
olute path on
element")
SyntaxError: cannot use absolute path on element
>>> for m in tree.findall('functions'):
print m.find('molecular_class').text
>>> for m in tree.findall('functions'):
print m.find('molecular_c
it us unparsable.
Would you please help me /guide me what the problem
is. Apologies if i am completely ignoring somethings.
PS: Attached is the XML file that I am using.
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> ps python wrote:
> > Kent and Dany,
> > Thanks for y
-Repost. considering that my previous email lost -
hi,
can any one pls. help me on this simple issue. I
keep
forgetting some simple things and they turn out to
be
very important later.
i have a list 'a', and now i want to write all the
elements back in to a string. 'apple is a good
fruit'
hi,
can any one pls. help me on this simple issue. I keep
forgetting some simple things and they turn out to be
very important later.
i have a list 'a', and now i want to write all the
elements back in to a string. 'apple is a good fruit'
- getting this back into a string has drained my
brain.
x27;)
iter = root.getiterator()
Here the whole XML document is loaded as element tree
and how should this iter into a format where I can
apply findall() method.
thanks
mdan
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> ps python wrote:
> > Hi,
> >
> > using Ele
Hi,
using ElementTree, how can I extract text of a
particular element, or a child node.
For example:
Signal transduction
Energy process
I looked at some tutorials (eg. Ogbuji). Those
examples described to extract all text of nodes and
child nodes.
In
Hi,
using ElementTree, how can I extract text of a
particular element, or a child node.
For example:
Signal transduction
__
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.sha
sorry for repost. awaiting to hear from some members.
a scientist suggested me to try biopython. This point
is not just with genbank sequences. what will i do if
i have to parse a paragraph for some expression.
thanks again.
hi,
I am a new python learner. i am trying to parse a
file using
hi,
I am a new python learner. i am trying to parse a
file using regular expressions.
LOCUS NM_005417 4145 bpmRNA
linear PRI 04-DEC-2005
DEFINITION Homo sapiens v-src sarcoma (Schmidt-Ruppin
A-2) viral oncogene
homolog (avian) (SRC), transcript variant
11 matches
Mail list logo