some questions

Fredrik Lundh fredrik at pythonware.com
Mon Jul 14 16:33:01 EDT 2003


Andreas Bauer wrote:

> Could anybody tell me how to hide a varibale e.g. in a url
> Example
>
> for i in (0,5):
>         u = urllib.urlopen("http://www.versionxzy.com/page
>         - here the variable e.g page1,page2,page3.html

here's one way to do it:

for i in range(1, 5):
    u = urllib.urlopen("http://www.versionxzy.com/page%d.html" % i)

more here:

http://www.python.org/doc/current/tut/node9.html
http://www.python.org/doc/current/lib/typesseq-strings.html

(reading the entire tutorial won't hurt, of course)

</F>

<!-- (the eff-bot guide to) the python standard library (redux):
http://effbot.org/zone/librarybook-index.htm
-->








More information about the Python-list mailing list