[perl-python] get web page programatically

Dan Perl danperl at rogers.com
Fri Feb 4 14:21:42 EST 2005


"Xah Lee" <xah at xahlee.org> wrote in message 
news:1107543599.362575.210730 at o13g2000cwo.googlegroups.com...
# note the line
# from <library_name> import <function_name1,function_name2...>
# it reads the library and import the function name
# to see available functions in a module one can use "dir"
# import urllib; print dir(urllib)

After about a month, this tutorial has finally reached the syntax of the 
"import" statement!

And word of advice to python beginners, "print dir(urllib)" is not very 
useful in the sense mentioned here (it prints all the names defined in the 
module with no explanations, and those names are not only functions, BTW). 
But "help(urllib)" is much more useful.  Even with such a simple script, 
this tutorial still managed to give some bad advice. 





More information about the Python-list mailing list