Thread: For and if

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

    Join Date
    Jan 2006
    Location
    Kansas
    Posts
    10
    Rep Power
    0

    For and if


    I have the following code that I am ruining. I can't figure out how to achieve what I want to do
    Code:
    for i in movetoready:
    	startsize = os.path.getsize(i)
    	time.sleep(3)
    	endsize = os.path.getsize(i)
    		if startsize = endsize:
    			findertools.move(printout + i, readypath + i)
    		else:
    			continue
    move to ready is a list of files. I want to make sure that the application is done writing to the file before I copy it so I wait 3 seconds and if the file size is the same then I copy it. if it's not then I move on to the next file in the list. . . . . . what am I doing wrong????
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    35
    Code:
    if startsize = endsize:
    You need == to compare them; = is only used to assign a value to something.

IMN logo majestic logo threadwatch logo seochat tools logo