Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Please help!

    2 answers - 63 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit


    Tutor maillist - Tutor (AT) python (DOT) org
  • No.1 | | 942 bytes | |

    Man! I was thinking that it was simple. This is a little bit hard
    but will try to make sense of it as I can.

    K, the way this list operates is that you try to solve it yourself.
    When it doesn't work you tell us what you tried to do and what
    went wrong. We then try to point you in the right direction.

    Thank you for your assistance. I'm glad you're up there to assist.

    The tutor list are all here waiting to help. We are like any good
    teacher, we don't just give answers out will-nilly but we do try
    to steer you to the solution so that you understand it for the future.

    If you do have a problem post the code that causes the problem
    and also paste in any error messages you get - the whoile error
    not just the last line.

    Have a go, let us see what is sticking you, we are here to help,

    Alan G

    Tutor maillist - Tutor (AT) python (DOT) org
  • No.2 | | 3567 bytes | |

    MATATA EMMANUEL wrote:
    Alan,

    Man! I was thinking that it was simple. This is a little bit hard but
    will try to make sense of it as I can.

    How would you fetch the shapefile with your browser? Is there a url to
    download the file? It's pretty simple to fetch a web page or other
    resource from a URL and save it to a local file. urllib.urlretrieve()
    will do it.

    If you have to authenticate (login) to the web site it gets a little
    more complex. urllib2 is similar to urllib but it has more options and
    supports authentication. There is a tutorial for urllib2 here:

    Kent

    Thank you for your assistance. I'm glad you're up there to assist.

    Matt

    From: /"Alan Gauld" <alan.gauld (AT) freenet (DOT) co.uk>/
    To: /"MATATA EMMANUEL" <emmatata (AT) hotmail (DOT) com>/
    CC: /<tutor (AT) python (DOT) org>/
    Subject: /Re: [Tutor] Please help!!/
    Date: /Sat, 20 May 2006 17:58:20 +0100/
    >[CCing back to list]
    >
    >>I know HTML even if I haven't used it for sometimes. I Also know
    >>couple other programming languages (Visual basic, some C++).
    >>I just taken a Python course of writting Python scripts for ArcGIS
    >>so that if you sent me a script, I will be able to understand it.

    >
    >K, now we know the background we know where to pitch the reply.
    >I don't have a script that will do exactly what you want but someone
    >else posted a snippet showing how to use urllib.
    >
    >If you need to parse the html that you read from urllib then you
    >might
    >find BeautifulSoup worth a look.
    >
    >
    >
    >It makes extracting elements from html fairly painless.
    >
    >But if its easy to find a simple search of the string for the img
    >tag
    >may suffice.
    >
    >HTH,
    >
    >Alan Gauld
    >Author of the Learn to Program web site
    >
    >
    >>

    >From: "Alan Gauld" <alan.gauld (AT) freenet (DOT) co.uk>
    >To: "MATATA EMMANUEL" <emmatata (AT) hotmail (DOT) com>,<Tutor (AT) python (DOT) org>
    >Subject: Re: [Tutor] Please help!!
    >Date: Sat, 20 May 2006 13:15:41 +0100
    >>>I'm tasked to write a Paython script which is supposed to hit a

    >>web >>site and download a shapefile from that web site.
    >>
    >>The urllib module should do that for you but
    >>
    >>>I don't have any clue and would like your help.

    >>
    >>What do you know?
    >>Do you understand HTML? and specifically how to create and read
    >>img >tags?
    >>
    >>Do you know any Python? Do you know any other programming
    >>language?
    >>
    >>>I use 9.x if this matter.

    >>
    >>Version 9.x of what?

    >System - on a Mac perhaps?
    >>If so it shouldn't matter since Python's urllib works K on the
    >>older versions.
    >>
    >>We really need a liittle more background to help further.
    >>
    >>HTH,
    >>
    >>Alan G.
    >>
    >>

    >
    >


    Tutor maillist - Tutor (AT) python (DOT) org

    Tutor maillist - Tutor (AT) python (DOT) org

Re: Please help!


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "Python"

EMSDN.COM