Im working on a small block of code that compares a argumented value to a file seached value. Every time i run the code it and give it the argumented value either lower or higher than i know the searched value is it gives me the opisite answer of what i want.

import requests, shutil, datetime, glob, os, csv,fnmatch,StringIO,smtplib,argparse
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from os import path

parser = argparse.ArgumentParser(description='Search art folders.')
parser.add_argument('-b', help='The base path', required=False, dest='basePath', metavar='Base directory path',default='/home/hatterx/Desktop')
parser.add_argument('-s', help='Change File size', required=True, dest ='changesize', metavar='Change size', default='0')
parser.add_argument('-S', help='Change File Size', required=True, dest ='changeSize', metavar='Change Size', default='0')
args = parser.parse_args()


size = path.getsize(fileFull)

Size = path.getsize(fileAbriv)


if args.changesize > (size):
    sendEmail(args.reciveEmail, SUBJECT, BODY)
else:
    print (size)
    print (fileFull)

if args.changeSize > (Size):
    sendEmail(args.reciveEmail, Subject, Body)
else:
    print (Size)
    print (fileAbriv)

with the if statements the size and Size have to be str(size) and str(Size).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.