#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    28
    Rep Power
    0

    Multiple Function Problem


    Problem:
    well atleast it is for me :P
    • You have a folder named raws:
    • raws contains a variant amount of sub folders with numbered names of nine digits (ex. 947656338) in which contain various image formats with various names (ex. jims-dog.jpg, mygirlfriend3.jpeg)
    • you need to create three new folders inside each sub folder named orig, small, smaller.
    • you need to rename each image in the sub folder to match the name of the sub folder with no extension
    • you need to make one copy of said image in the sub folder and send it to the orig folder then use ?imagemagick? to do the same with the small and smaller folders but make them smaller
    • after doing this process on all of the sub folders and corresponding images you then need to copy the contents of [b]raws[/] to a different folder


    Any suggestions? This is what I have so far (can you tell I'm a newbie):
    PHP Code:
    from Tkinter import *
    import os
    import glob

    aimages 
    "/home/julie/Desktop/impy"
    zimages "/home/julie/Desktop/expy"

    for folder in glob.glob(aimages):
        for 
    image in glob.glob(folder)
        try:
            
    folname os.path(folder)
            
    os.rename(imagefolder
    I was planning on using Tkinter to show a display of the images as they get resized.

    Any help is greatly appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    12
    Hi I am in school so i cant check but I doubt your able to do it with tkinter atleast without making it hard for your self with changing the image in the label widget...
    Those people who think they know everything are a great annoyance to those of us who do.
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    Change
    Code:
    from Tkinter import *
    import os
    import glob
    
    aimages = "/home/julie/Desktop/impy"
    zimages = "/home/julie/Desktop/expy"
    
    for folder in glob.glob(aimages):
        for image in glob.glob(folder)
        try:
            folname = os.path(folder)
            os.rename(image, folder)
    to
    Code:
    from Tkinter import *
    import os, glob
    
    aimages = "/home/julie/Desktop/impy"
    zimages = "/home/julie/Desktop/expy"
    
    for folder in glob.glob(aimages):
        for image in glob.glob(folder):
            try:
                folname = os.path(folder)
                os.rename(image, folder)
            except Exception, inst:
                print inst 
                os.system('PAUSE')
    I don't feel like testing the code.
    I simply fixed a few minor errors that you had.
    Last edited by †Yegg†; November 10th, 2005 at 02:54 PM.

IMN logo majestic logo threadwatch logo seochat tools logo