Desperate help required for Python assignment
Delaney, Timothy
tdelaney at avaya.com
Wed Oct 17 04:03:32 EDT 2001
> From: nachiket_gole at hotmail.com [mailto:nachiket_gole at hotmail.com]
>
> I am new to Python doing a crash course in University. I have a
> assignment to submit in two days the specifications of which are:
> 1.Write a script in python which maps a set of linked webpages. It
> should take the URL as a command line argument, retireve the page,
> extract the URL's of pages linked to by the page in question and store
> them in a data structure for the page. It should then repeat this
> with other linked pages to a depth of 5. It should visit each page
> only once.
> 2.The script should also be able to take -L as a command line argument
> and that being the case should only follow links on the same server as
> the current site.
> 3.The script should also record the titles of links in the documents
> eg
> Mysite -- > http://mysite.com
> 4.Finally all this has to be displayed as a tree for eg
> >python mytest.py "some url"
> http://.....
> + http://........
> + http://.......
> + http://......
> Please can some of the Gurus on this newsgroup help me out with a
> working solution as with my limited knowledge i am no position to
> handle this assignment in two days.
Unfortunately, you have not shown any evidence that you have even attempted
to do this assignment.
Assuming that you have Python configured correctly on your machine, you
should be able to design and develop this assignment within 2 days, even if
you know zero Python when you start. This of course assumes that you are a
competent programmer in at least one other language. If you are not, you
have no chance of passing this assignment.
First step is to design what you want to do. Don't even think about the code
at this point - however, *do* write pseudo-code (it will help you later).
*Then* you need to translate your design into Python. If you have written
pseudo-code, you should find this very easy. Simply take the design, and use
the standard Python documentation to convert it to Python. If you have a
good design you should find that the resulting Python code is *very* similar
to your pseudo-code.
There are certain standard libraries you will need/want to use for this
assignment. Probably the most straight-forward method will use the sys,
urllib and either re or string modules.
Everything you need is in the standard documentation.
If you want more help, you should post part of what you have already
developed over the previous 2-6 weeks that you have had this assignment.
Tim Delaney
More information about the Python-list
mailing list