Re: Instead of saving text files i need as html

2006-06-09 Thread Sion Arrowsmith
Tim Chase <[EMAIL PROTECTED]> wrote: >> [ ... ] >> urllib.urlretrieve(lines.strip('/n'), 'c:\\temp\\' \ >> + outfilename.strip('\n')[7:] + '.html') > [ ... ] I'm not sure what the odd >slicing is for, but I'll presume the OP knows what they're doing. It's taking the "http://"; o

Re: Instead of saving text files i need as html

2006-06-08 Thread Tim Chase
> Is this what you mean? > > -begin- > import urllib > urlfile = open(r'c:\temp\url.txt', 'r') > for lines in urlfile: > try: > outfilename = lines.replace('/', '-') > urllib.urlretrieve(lines.strip('/n'), 'c:\\temp\\' \ > + outfilename.strip('\n')[7:] + '.html'

Re: Instead of saving text files i need as html

2006-06-08 Thread bruno at modulix
Shani wrote: > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is saved. What you write in a text file is up to you - an

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"3c273" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Or is this what you mean? > -begin- > import urllib > urlfile = open('c:\\temp\\url.txt', 'r') > newurlfile = open('c:\\temp\\newurls.html', 'w') > newurlfile.write(' \n\n') > for lines in urlfile: > try: > if

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"Shani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is s

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"Shani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is s

Re: Instead of saving text files i need as html

2006-06-08 Thread Larry Bates
Then just write HTML around your list. I would guess you want them inside a table. Just write appropriate HTML tags before/after the urls. If you want the URLs to be clickable make them in into url lines. -Larry Bates Shani wrote: > I have the following code which takes a list of urls > "http:

Instead of saving text files i need as html

2006-06-08 Thread Shani
I have the following code which takes a list of urls "http://google.com";, without the quotes ofcourse, and then saves there source code as a text file. I wan to alter the code so that for the list of URLs an html file is saved. -begin- import urllib urlfile = open(r'c:\temp\url.txt', 'r')