Python - why don't this script work?

Ohmster root at dev.nul.invalid
Tue Oct 23 03:47:29 CEST 2007

I am trying to use this cool script that some MIT guy wrote and it just 
does not work, I get a stream of errors when I try to run it. It is 
supposed to visit a URL and snag all of the pictures on the site. Here is 
the script:

Here is my output when I try to run it on my Fedora 6 machine:

[ohmster at ohmster bench]$
/home/ohmster/scripts/ line 59: from: command not found
[ohmster at ohmster bench]$

The script is to be folowed up with another one to weed out the small 
thumbnails and banner images, here is the base URL:

Line 59 in reads as follows:

59:	from sgmllib import SGMLParser
60:	import urllib
70:	from urlparse import urlparse, urljoin
71:	import re
72:	import os

Can anyone tell me what is wrong with this script and why it will not run? 
It does not like the command "from", is there such a command in python? 
Does this mean that python has the "import" command but not the "from" 
command or do we not know this yet as it hangs right away when it hits the 
very first word of the script, "from"? Maybe this is not a Linux script or 
something? I wonder why it needs the x-server anyway, I tried running it 
from an ssh term window and it had a fit about no x-server so now I am 
doing this in a gnome term window. This looked so cool too. :(

Please be patient with me, I do not know python at all, I just want for 
this script to work and if I see enough working examples of python, I may 
just take up study on it, but for right now, I do not know the language. 
Total newbie.


~Ohmster | ohmster /a/t/ ohmster dot com
Put "messageforohmster" in message body
(That is Message Body, not Subject!)
to pass my spam filter.

More information about the Python-list mailing list