Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88415

Re: New to Programming - XML Processing

References <upomhad4fj6sulnr5so8088fdqpo0nk6mu@4ax.com> <0b0fd795-8f3e-443e-acc2-aed9b5d200ba@googlegroups.com>
From Andrew Farrell <amfarrell@mit.edu>
Date 2015-03-31 23:27 -0500
Subject Re: New to Programming - XML Processing
Newsgroups comp.lang.python
Message-ID <mailman.6.1427864895.12925.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

You should follow Rustom's advice before just diving into the blog post I
linked to. Otherwise you risk blindly following things and losing your
bearings when you run into bugs.

On Tue, Mar 31, 2015 at 11:17 PM, Rustom Mody <rustompmody@gmail.com> wrote:

> On Wednesday, April 1, 2015 at 8:57:15 AM UTC+5:30, catperson wrote:
> > I am new to programming, though not new to computers.  I'm looking to
> > teach myself Python 3 and am working my way through a tutorial.  At
> > the point I'm at in the tutorial I am tasked with parsing out an XML
> > file created with a Garmin Forerunner and am just having a terrible
> > time getting my head around the concepts.  What I'm looking for is
> > some suggested reading that might give me some of the theory of
> > operation behind ElementTree and then how to parse out specific
> > elements.  Most of what I have been able to find in examples that I
> > can understand use very simplistic XML files and this Garmin file is
> > many levels of sub-elements and some of those elements have attributes
> > assigned, like <Activity Sport="Running">.
> >
> > I'm hoping with enough reading I can experiment and work my way
> > through the problem and end up with a hopefully clear understanding of
> > the ElementTree module and Dictionairies.
> >
> > Thanks for any suggestions in advance.
>
> Suggestions:
> 1. Learn to use the interpreter interactively; ie (at the least)¹ ie
>
> a. Start up python (without a program)
> b. Play around with trivial expressions
> c. Explore introspective features - help(), type() dir()
>
> 2. Do you know about triple-quoted strings?
> a. Start small (or trivial) sub-parts of your XML as triple-quoted
> examples in the
> interpreter and start throwing them at elementtree
> b. If they dont work trivialize further; if they work add complexity
> -----------
> ¹ At the least because environments like Idle are more conducive to such
> playing
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

New to Programming - XML Processing catperson <me@anonymous.invalid> - 2015-03-31 20:27 -0700
  Re: New to Programming - XML Processing Ben Finney <ben+python@benfinney.id.au> - 2015-04-01 15:08 +1100
  Re: New to Programming - XML Processing Rustom Mody <rustompmody@gmail.com> - 2015-03-31 21:17 -0700
    Re: New to Programming - XML Processing Andrew Farrell <amfarrell@mit.edu> - 2015-03-31 23:27 -0500
    Re: New to Programming - XML Processing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-01 09:00 +0100
    Re: New to Programming - XML Processing catperson <me@anonymous.invalid> - 2015-04-01 15:33 -0700
      Re: New to Programming - XML Processing sohcahtoa82@gmail.com - 2015-04-01 17:46 -0700
  Re: New to Programming - XML Processing Rustom Mody <rustompmody@gmail.com> - 2015-03-31 21:49 -0700
  Re: New to Programming - XML Processing Andrew Farrell <amfarrell@mit.edu> - 2015-03-31 23:26 -0500
  Re: New to Programming - XML Processing Burak Arslan <burak.arslan@arskom.com.tr> - 2015-04-01 16:44 +0300

csiph-web