POV-Ray : Newsgroups : povray.off-topic : Merge hundreds of images together? : Re: Merge hundreds of images together? Server Time
4 Sep 2024 05:19:59 EDT (-0400)
  Re: Merge hundreds of images together?  
From: Aydan
Date: 7 Jul 2010 11:55:01
Message: <web.4c34a1ee7dfe797f3771cd8e0@news.povray.org>
> I should have thought of this; I have written code in Python for
> handling PPMs. Only problem is that I have to make and format a list of
> the files so that Python can read the list. My Python skills are not
> such that I can call a Python program with program(args). Still, a Vim
> script should make quick work of that.
>
> Shouldn't need longs. Hope not, at least, I've got no idea how to deal
> with them in Python.
>
>   -Shay

import os
import sys
path=sys.argv[1]
filelist=os.listdir(path)
#print the file list:
print "\n".join(filelist)
for filename in filelist:
  if os.path.isfile(filename):
    #do whatever

and start your script with the folder as a parameter, e.g. ./foo.py
/home/usr/blah


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.