On Sun, 21 Feb 2010 10:49:19 am Dayo Adewunmi wrote:
> Hi all,
>
> This script I'm working on, should take all the image files in the
> current directory and generate an HTML thumbnails.
>
> import os
> import urllib
You import urllib, but don't appear to use it anywhere.
>
> # Generate thumbnail
>
>
>
> If you're using OS functions you should NOT bank on the slashes being
> forward-slashes. This is platform-specific behavior. You should use
> os.path.split() to get the elements of your path and do a "/".join() on
> them. Otherwise your code will break on Windows because the path will be
On Sat, Feb 20, 2010 at 6:11 PM, Dayo Adewunmi wrote:
> Shashwat Anand wrote:
>
>>
>>
>>
>>
>> for dirname, subdirname, filenames in os.walk(absolutePath):
>> for filename in filenames:
>> print ""
>>%(currentdir,filename,currentdir,filename)
>>
>>
>> I see a small
Shashwat Anand wrote:
for dirname, subdirname, filenames in os.walk(absolutePath):
for filename in filenames:
print ""
%(currentdir,filename,currentdir,filename)
I see a small typo here.
print ""
%(currentdir,filename,currentdir,filename) should rather
>
> for dirname, subdirname, filenames in os.walk(absolutePath):
> for filename in filenames:
> print ""
> %(currentdir,filename,currentdir,filename)
>
>
I see a small typo here.
print ""
%(currentdir,filename,currentdir,filename) should rather be print ""
%(currentdir,filenam
Hi all,
This script I'm working on, should take all the image files in the current
directory
and generate an HTML thumbnails.
import os
import urllib
# Generate thumbnail gallery
def genThumbs():
# Get current directory name
absolutePath = os.getcwd()
urlprefix = "http://kili.org/~day