Skip to content

Instantly share code, notes, and snippets.

@neurojojo
Created July 31, 2022 13:48
Show Gist options
  • Save neurojojo/1a4d0988247fae75e048980c69a02a72 to your computer and use it in GitHub Desktop.
Save neurojojo/1a4d0988247fae75e048980c69a02a72 to your computer and use it in GitHub Desktop.
class fileclass:
def __init__(self, input):
self.Filename = input
self.Size = os.path.getsize(input)
def summary(self):
print(f'File is named {self.Filename} and has size {self.Size}')
def __lt__(obj1, obj2):
if obj1.Size<obj2.Size:
print(f'{obj1.Filename} is smaller than {obj2.Filename}\n')
if obj2.Size<obj1.Size:
print(f'{obj2.Filename} is smaller than {obj1.Filename}\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment