├── .gitattributes ├── fivedots.py ├── README.md ├── sofdotclock.py └── sofdotClass.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /fivedots.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Thu Jun 27 12:21:55 2019 5 | 6 | @author: damienrigden 7 | 8 | 9 | This program draws 5 colorful dots that count up with the seconds and reset. 10 | 11 | """ 12 | 13 | from graphics import GraphWin, Point, Circle 14 | from time import strftime, sleep 15 | 16 | win = GraphWin('Fivedots', 500, 100) 17 | 18 | pt1 = Point(50, 50) 19 | pt2 = Point(150, 50) 20 | pt3 = Point(250, 50) 21 | pt4 = Point(350, 50) 22 | pt5 = Point(450, 50) 23 | 24 | cir1 = Circle(pt1, 30) 25 | cir2 = Circle(pt2, 30) 26 | cir3 = Circle(pt3, 30) 27 | cir4 = Circle(pt4, 30) 28 | cir5 = Circle(pt5, 30) 29 | 30 | cir1.setFill('red') 31 | cir2.setFill('orange') 32 | cir3.setFill('yellow') 33 | cir4.setFill('green') 34 | cir5.setFill('blue') 35 | 36 | ones = [1,6,11,16,21,26,31,36,41,46,51,56] 37 | twos = [2,7,12,17,22,27,32,37,42,47,52,57] 38 | threes = [3,8,13,18,23,28,33,38,43,48,53,58] 39 | fours = [4,9,14,19,24,29,34,39,44,49,54,59] 40 | fives = [0,5,10,15,20,25,30,35,40,45,50,55] 41 | 42 | while True: 43 | 44 | if int(strftime('%S')) in ones: 45 | cir1.undraw() 46 | cir1.draw(win) 47 | cir2.undraw() 48 | cir3.undraw() 49 | cir4.undraw() 50 | cir5.undraw() 51 | 52 | if int(strftime('%S')) in twos: 53 | cir2.draw(win) 54 | 55 | if int(strftime('%S')) in threes: 56 | cir3.draw(win) 57 | 58 | if int(strftime('%S')) in fours: 59 | cir4.draw(win) 60 | 61 | if int(strftime('%S')) in fives: 62 | cir5.draw(win) 63 | 64 | sleep(1) 65 | 66 | if win.checkKey() == 'q': 67 | win.close() 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sof-Dot-Project 2 | 3 | Sof-Dot stands for "Switch on five, Double on ten" 4 | This is a numbering system I invented which uses dots and dashes 5 | in two rows to Represent numbers in two digit increments 6 | separated by a delimeter bar. 7 | The file "sofdotClass" should have everything needed to use these numbers 8 | 9 | Dots represent "ones" 10 | 11 | "One" "Two" "Three" "Four" 12 | _______ _______ _______ _______ <--Delimeter Bar 13 | <--Row 2 14 | ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ <--Row 1 15 | 16 | When you reach 5, you add a bar 17 | 18 | "Five" 19 | _______ <--Delimeter Bar 20 | <--Row 2 21 | ▄▄▄ <--Row 1 22 | 23 | Then continue counting up with ones on the second row 24 | 25 | "Six" "Seven" "Eight" "Nine" 26 | _______ _______ _______ _______ <--Delimeter Bar 27 | ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ <--Row 2 28 | ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ <--Row 1 29 | 30 | When you reach 10, the "Five Bar" doubles 31 | 32 | "Ten" 33 | _______ <--Delimeter Bar 34 | ▄▄▄ <--Row 2 35 | ▄▄▄ <--Row 1 36 | 37 | Then continue counting up with ones on the first row 38 | 39 | "Eleven" "Twelve" "Thirteen" "Fourteen" 40 | _______ _______ _______ _______ <--Delimeter Bar 41 | ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ <--Row 2 42 | ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ ▄ <--Row 1 43 | 44 | On 15 the "Five Bar" Changes and the cycle repeats 45 | 46 | "Fifteen" 47 | _______ <--Delimeter Bar 48 | <--Row 2 49 | ▄▄▄ ▄ <--Row 1 50 | 51 | There is some logic behind the progression of the five bars, 52 | but for clarity I will just list them out 53 | 54 | ▄▄▄ <--Five 55 | ▄▄▄ ▄ <--Fifteen 56 | ▄▄▄ ▄ ▄ <--Twenty-Five 57 | ▄ ▄▄▄ <--Thirty-Five 58 | ▄ ▄▄▄ ▄ <--Forty-Five 59 | ▄ ▄ ▄▄▄ <--Fifty-Five 60 | ▄▄▄▄▄ <--Sixty-Five 61 | ▄▄▄▄▄ ▄ <--Seventy-Five 62 | ▄ ▄▄▄▄▄ <--Eighty-Five 63 | ▄▄▄ ▄▄▄ <--Ninety-Five 64 | 65 | Numbers Longer Than Two Digits Are represented by successive rows 66 | Reading from bottom to top 67 | 68 | "6732" 69 | _______ 70 | ▄▄▄ ▄ ▄ 71 | ▄ ▄ 72 | _______ 73 | ▄ ▄ 74 | ▄▄▄▄▄ 75 | 76 | Thanks for reading, and welcome to this repository! 77 | -------------------------------------------------------------------------------- /sofdotclock.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Thu Jun 27 12:21:55 2019 5 | 6 | @author: damienrigden 7 | 8 | This program crates a graphical window of a clock drawn using sofdot numbers. 9 | It takes as an argument the desired clock face size 10 | 11 | """ 12 | 13 | from graphics import GraphWin, Point, Circle, Rectangle 14 | from time import strftime 15 | from sofdotClass import Sofdot as Sd 16 | from sys import argv 17 | 18 | 19 | try: 20 | face = int(argv[1]) 21 | if face < 50: 22 | face = 50 23 | 24 | except: 25 | print('Argument should be an integer equal to desired clock face size.') 26 | print('Default face size 400 used.') 27 | face = 400 28 | 29 | r = face * .075 /2 30 | bgc = '#f8f1e2' 31 | tgc = '#4b3106' 32 | 33 | win = GraphWin('Sof-Dot Clock', face, face) 34 | win.setBackground(bgc) 35 | 36 | seconds = '%S' 37 | minutes = '%M' 38 | hours = '%H' 39 | 40 | def main(): 41 | hourflag = strftime(hours) 42 | minuteflag = strftime(minutes) 43 | secondflag = strftime(seconds) 44 | 45 | ctrltograph(timetoctrl(seconds), secgeom) 46 | ctrltograph(timetoctrl(minutes), mingeom) 47 | ctrltograph(timetoctrl(hours), hourgeom) 48 | 49 | while True: 50 | if strftime(seconds) != secondflag: 51 | ctrltograph(timetoctrl(seconds), secgeom) 52 | secondflag = strftime(seconds) 53 | 54 | if strftime(minutes) != minuteflag: 55 | ctrltograph(timetoctrl(minutes), mingeom) 56 | minuteflag = strftime(minutes) 57 | 58 | if strftime(hours) != hourflag: 59 | ctrltograph(timetoctrl(hours), hourgeom) 60 | hourflag = strftime(hours) 61 | 62 | if win.checkKey() == 'q': 63 | win.close() 64 | 65 | def timetoctrl(time): 66 | ctrl = Sd(strftime(time)) 67 | 68 | return ctrl.getcontrol() 69 | 70 | def ctrltograph(ctrl, elements): 71 | for i in range(1,3): 72 | for j in range(7): 73 | elements[0][i][j].undraw() 74 | if ctrl[0][i][j]: 75 | elements[0][i][j].draw(win) 76 | 77 | 78 | """Hours Geometry""" 79 | hc8 = Point(face * .1375,face * .1375) 80 | hc10 = Point(face * .2875,face * .1375) 81 | hc12 = Point(face * .4375,face * .1375) 82 | hc14 = Point(face * .5875,face * .1375) 83 | hc1 = Point(face * .1375,face * .31875) 84 | hc3 = Point(face * .2875,face * .31875) 85 | hc5 = Point(face * .4375,face * .31875) 86 | hc7 = Point(face * .5875,face * .31875) 87 | 88 | hr5 = Point(face * .1375, face * .175) 89 | hr6 = Point(face * .2875, face * .1) 90 | hr7 = Point(face * .4375, face * .175) 91 | hr8 = Point(face * .5875, face * .1) 92 | hr1 = Point(face * .1375, face * .35625) 93 | hr2 = Point(face * .2875, face * .28125) 94 | hr3 = Point(face * .4375, face * .35625) 95 | hr4 = Point(face * .5875, face * .28125) 96 | 97 | H1 = Circle(hc1, r) 98 | H3 = Circle(hc3, r) 99 | H5 = Circle(hc5, r) 100 | H7 = Circle(hc7, r) 101 | H8 = Circle(hc8, r) 102 | H10 = Circle(hc10, r) 103 | H12 = Circle(hc12, r) 104 | H14 = Circle(hc14, r) 105 | 106 | H2 = Rectangle(hr1, hr2) 107 | H4 = Rectangle(hr2, hr3) 108 | H6 = Rectangle(hr3, hr4) 109 | H9 = Rectangle(hr5, hr6) 110 | H11 = Rectangle(hr6, hr7) 111 | H13 = Rectangle(hr7, hr8) 112 | 113 | #List of graphical elements structured to match the Sofdot control, hours 114 | hourgeom = [([None], [H8, H9, H10, H11, H12, H13, H14], [H1, H2, H3, H4, H5, H6, H7])] 115 | 116 | #Set properties for hour elements 117 | #triple nested loops is messy but N is small, getting around sofdot control structure 118 | for u in range(1,3): 119 | for v in range(7): 120 | for geomh in hourgeom: 121 | geomh[u][v].setFill(tgc) 122 | geomh[u][v].setOutline(tgc) 123 | geomh[u][v].draw(win) 124 | 125 | """Minutes Geometry""" 126 | mc8 = Point(face * .1375,face * .68125) 127 | mc10 = Point(face * .2875,face * .68125) 128 | mc12 = Point(face * .4375,face * .68125) 129 | mc14 = Point(face * .5875,face * .68125) 130 | mc1 = Point(face * .1375,face * .8625) 131 | mc3 = Point(face * .2875,face * .8625) 132 | mc5 = Point(face * .4375,face * .8625) 133 | mc7 = Point(face * .5875,face * .8625) 134 | 135 | mr5 = Point(face * .1375, face * .71875) 136 | mr6 = Point(face * .2875, face * .64375) 137 | mr7 = Point(face * .4375, face * .71875) 138 | mr8 = Point(face * .5875, face * .64375) 139 | mr1 = Point(face * .1375, face * .9) 140 | mr2 = Point(face * .2875, face * .825) 141 | mr3 = Point(face * .4375, face * .9) 142 | mr4 = Point(face * .5875, face * .825) 143 | 144 | M1 = Circle(mc1, r) 145 | M3 = Circle(mc3, r) 146 | M5 = Circle(mc5, r) 147 | M7 = Circle(mc7, r) 148 | M8 = Circle(mc8, r) 149 | M10 = Circle(mc10, r) 150 | M12 = Circle(mc12, r) 151 | M14 = Circle(mc14, r) 152 | 153 | M2 = Rectangle(mr1, mr2) 154 | M4 = Rectangle(mr2, mr3) 155 | M6 = Rectangle(mr3, mr4) 156 | M9 = Rectangle(mr5, mr6) 157 | M11 = Rectangle(mr6, mr7) 158 | M13 = Rectangle(mr7, mr8) 159 | 160 | #List of graphical elements structured to match the Sofdot control, minutes 161 | mingeom = [([None], [M8, M9, M10, M11, M12, M13, M14], [M1, M2, M3, M4, M5, M6, M7])] 162 | 163 | #Set properties for minute elements 164 | #triple nested loops is messy but N is small, getting around sofdot control structure 165 | for w in range(1,3): 166 | for x in range(7): 167 | for geomm in mingeom: 168 | geomm[w][x].setFill(tgc) 169 | geomm[w][x].setOutline(tgc) 170 | geomm[w][x].draw(win) 171 | 172 | """Seconds Geometry""" 173 | sc8 = Point(face * .7375,face * .8625) 174 | sc10 = Point(face * .7375,face * .620833) 175 | sc12 = Point(face * .7375,face * .379167) 176 | sc14 = Point(face * .7375,face * .1375) 177 | sc1 = Point(face * .8625,face * .8625) 178 | sc3 = Point(face * .8625,face * .620833) 179 | sc5 = Point(face * .8625,face * .379167) 180 | sc7 = Point(face * .8625,face * .1375) 181 | 182 | sr5 = Point(face * .775, face * .8625) 183 | sr6 = Point(face * .7, face * .620833) 184 | sr7 = Point(face * .775, face * .379167) 185 | sr8 = Point(face * .7, face * .1375) 186 | sr1 = Point(face * .9, face * .8625) 187 | sr2 = Point(face * .825, face * .620833) 188 | sr3 = Point(face * .9, face * .379167) 189 | sr4 = Point(face * .825, face * .1375) 190 | 191 | S1 = Circle(sc1, r) 192 | S3 = Circle(sc3, r) 193 | S5 = Circle(sc5, r) 194 | S7 = Circle(sc7, r) 195 | S8 = Circle(sc8, r) 196 | S10 = Circle(sc10, r) 197 | S12 = Circle(sc12, r) 198 | S14 = Circle(sc14, r) 199 | 200 | S2 = Rectangle(sr1, sr2) 201 | S4 = Rectangle(sr2, sr3) 202 | S6 = Rectangle(sr3, sr4) 203 | S9 = Rectangle(sr5, sr6) 204 | S11 = Rectangle(sr6, sr7) 205 | S13 = Rectangle(sr7, sr8) 206 | 207 | #List of graphical elements structured to match the Sofdot control, seconds 208 | secgeom = [([None], [S8, S9, S10, S11, S12, S13, S14], [S1, S2, S3, S4, S5, S6, S7])] 209 | 210 | 211 | #Set properties for second elements 212 | #triple nested loops is messy but N is small, getting around sofdot control structure 213 | for y in range(1,3): 214 | for z in range(7): 215 | for geoms in secgeom: 216 | geoms[y][z].setFill(tgc) 217 | geoms[y][z].setOutline(tgc) 218 | geoms[y][z].draw(win) 219 | 220 | """Bar Geometry""" 221 | bc1 = Point(face * .1375,face * .5) 222 | bc3 = Point(face * .5875,face * .5) 223 | 224 | br1 = Point(face * .1375,face * .5375) 225 | br2 = Point(face * .5875,face * .4625) 226 | 227 | B1 = Circle(bc1, r) 228 | B3 = Circle(bc3, r) 229 | 230 | B2 = Rectangle(br1, br2) 231 | 232 | bargeom = [B1, B2, B3] 233 | 234 | for geomb in bargeom: 235 | geomb.setFill(tgc) 236 | geomb.setOutline(tgc) 237 | geomb.draw(win) 238 | 239 | 240 | if __name__ == '__main__': 241 | main() -------------------------------------------------------------------------------- /sofdotClass.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Sun Mar 17 19:28:40 2019 5 | 6 | @author: damienrigden 7 | """ 8 | 9 | class Sofdot(object): 10 | def __init__(self, x): 11 | """ Initializes a Sof-Dot number. 12 | Sof-Dot stands for "Switch on Five - Double on Ten" 13 | This is a system which uses dashes and dots 14 | to represent numbers in two digit increments 15 | read from bottom to top. 16 | 17 | Input can be a positive or negative, int or float number 18 | Output will always be a positive 'int' sofdot 19 | Non-supported object types will return the null character 20 | 21 | To view an object use .plot()""" 22 | 23 | try: 24 | self.x = abs(int(x)) 25 | numstr = str(self.x) 26 | 27 | split10 = [] 28 | 29 | if len(numstr) % 2 == 0: 30 | for y in range(0,len(numstr),2): 31 | s = '' 32 | s += numstr[y] 33 | s += numstr[y+1] 34 | split10.append(s) 35 | for z in range(len(split10)): 36 | split10[z] = int(split10[z]) 37 | 38 | else: 39 | split10.append(numstr[0]) 40 | for y in range(1,len(numstr),2): 41 | s = '' 42 | s += numstr[y] 43 | s += numstr[y+1] 44 | split10.append(s) 45 | for z in range(len(split10)): 46 | split10[z] = int(split10[z]) 47 | split10.reverse() 48 | self.split10 = split10 49 | 50 | except: 51 | print("Improper use detected, argument: '{}' of Type: '{}'".format(x, str(type(x))[8:-2])) 52 | print("Sofdot argument must be type 'int' or 'float'") 53 | self.split10 = [100] 54 | self.x = None 55 | 56 | 57 | @staticmethod 58 | def __getsofdot(number): 59 | """Input: A single two digit number 60 | Output:Returns a tuple of three lists which represent 61 | a binary version of a two digit segment of a sofdot number 62 | two lists represent the number, one list is a delimeter bar 63 | this function is only used within the objet class""" 64 | dots = number % 5 65 | fives = number // 5 66 | switchflag = False 67 | tenflag = False 68 | 69 | zero = [0,0,0,0,0,0,0] 70 | five = [1,1,1,0,0,0,0] 71 | fifteen = [1,1,1,0,1,0,0] 72 | twentyfive = [1,1,1,0,1,0,1] 73 | thirtyfive = [1,0,1,1,1,0,0] 74 | fortyfive = [1,0,1,1,1,0,1] 75 | fiftyfive = [1,0,1,0,1,1,1] 76 | sixtyfive = [1,1,1,1,1,0,0] 77 | seventyfive = [1,1,1,1,1,0,1] 78 | eightyfive = [1,0,1,1,1,1,1] 79 | ninetyfive = [1,1,1,0,1,1,1] 80 | fivedict = {1:five, 2:five, 3:fifteen, 4:fifteen, 5:twentyfive, 6:twentyfive, \ 81 | 7:thirtyfive, 8:thirtyfive, 9:fortyfive, 10:fortyfive, \ 82 | 11:fiftyfive, 12:fiftyfive, 13:sixtyfive, 14:sixtyfive, \ 83 | 15:seventyfive, 16:seventyfive, 17:eightyfive, 18:eightyfive, \ 84 | 19:ninetyfive, 20:ninetyfive, 0:zero} 85 | 86 | onedot = [1,0,0,0,0,0,0] 87 | twodot = [1,0,1,0,0,0,0] 88 | threedot = [1,0,1,0,1,0,0] 89 | fourdot = [1,0,1,0,1,0,1] 90 | dotdict = {1:onedot, 2:twodot, 3:threedot, 4:fourdot, 0:zero} 91 | 92 | bar = [2,2,2,2,2,2,2] 93 | 94 | if fives % 2 == 0: 95 | switchflag = True 96 | 97 | if dots == 0: 98 | tenflag = True 99 | 100 | if switchflag and tenflag: 101 | return (bar, fivedict[fives], fivedict[fives]) 102 | 103 | elif switchflag: 104 | return (bar, fivedict[fives], dotdict[dots]) 105 | 106 | else: 107 | return (bar, dotdict[dots], fivedict[fives]) 108 | 109 | @staticmethod 110 | def __turntostring(dotlist): 111 | """Input: A single binary sofdot list 112 | Output: A single line string of dots and dashes. 113 | This function is only used within the object class""" 114 | string = '' 115 | for item in dotlist: 116 | if item == 1: 117 | string += '▄' 118 | elif item == 0: 119 | string += ' ' 120 | else: 121 | string += '_' 122 | return string 123 | 124 | def plot(self): 125 | """Input: A sofdot object 126 | Output:Plots a visual representation of a sofdot number""" 127 | for number in self.split10: 128 | sofdot = [] 129 | sofdot = self.__getsofdot(number) 130 | for row in sofdot: 131 | print(self.__turntostring(row)) 132 | 133 | def getcontrol(self): 134 | """Input: a sofdot object 135 | Output:Returns a complete list of binary data for a sofdot 136 | number. (This could be used to control an external program/hardware 137 | which would use sofdot numbers)""" 138 | control = [] 139 | for number in self.split10: 140 | sofdot = self.__getsofdot(number) 141 | control.append(sofdot) 142 | return control 143 | 144 | def __str__(self): 145 | if self.x == None: 146 | print('--Null Sofdot Detected--\n') 147 | 148 | return "Use plot() to view object. Use getcontrol() for control data." 149 | 150 | def __repr__(self): 151 | return 'Sofdot(%r)' % self.x 152 | 153 | def __add__(self, other): 154 | try: 155 | if self.x == None or other.x == None: 156 | print('--Null Sofdot Detected--\n') 157 | 158 | return Sofdot(self.x + other.x) 159 | 160 | except: 161 | raise TypeError("unsupported operand type(s) for +: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 162 | 163 | def __sub__(self, other): 164 | try: 165 | if self.x == None or other.x == None: 166 | print('--Null Sofdot Detected--\n') 167 | 168 | return Sofdot(self.x - other.x) 169 | 170 | except: 171 | raise TypeError("unsupported operand type(s) for -: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 172 | 173 | def __mul__(self, other): 174 | try: 175 | if self.x == None or other.x == None: 176 | print('--Null Sofdot Detected--\n') 177 | 178 | return Sofdot(self.x * other.x) 179 | 180 | except: 181 | raise TypeError("unsupported operand type(s) for *: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 182 | 183 | def __truediv__(self, other): 184 | try: 185 | if self.x == None or other.x == None: 186 | print('--Null Sofdot Detected--\n') 187 | 188 | return Sofdot(self.x / other.x) 189 | 190 | except: 191 | raise TypeError("unsupported operand type(s) for /: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 192 | 193 | def __floordiv__(self, other): 194 | try: 195 | if self.x == None or other.x == None: 196 | print('--Null Sofdot Detected--\n') 197 | 198 | return Sofdot(self.x // other.x) 199 | 200 | except: 201 | raise TypeError("unsupported operand type(s) for //: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 202 | 203 | def __mod__(self, other): 204 | try: 205 | if self.x == None or other.x == None: 206 | print('--Null Sofdot Detected--\n') 207 | 208 | return Sofdot(self.x % other.x) 209 | 210 | except: 211 | raise TypeError("unsupported operand type(s) for %: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 212 | 213 | def __pow__(self, other): 214 | try: 215 | if self.x == None or other.x == None: 216 | print('--Null Sofdot Detected--\n') 217 | 218 | return Sofdot(self.x ** other.x) 219 | 220 | except: 221 | raise TypeError("unsupported operand type(s) for ** or pow(): 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 222 | 223 | def __int__(self): 224 | if self.x == None: 225 | print('--Null Sofdot Detected--\n') 226 | 227 | return self.x 228 | 229 | def __eq__(self, other): 230 | try: 231 | if self.x == None or other.x == None: 232 | print('--Null Sofdot Detected--\n') 233 | 234 | return self.x == other.x 235 | 236 | except: 237 | raise TypeError("unsupported operand type(s) for ==: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 238 | 239 | def __ne__(self, other): 240 | try: 241 | if self.x == None or other.x == None: 242 | print('--Null Sofdot Detected--\n') 243 | 244 | return self.x != other.x 245 | 246 | except: 247 | raise TypeError("unsupported operand type(s) for !=: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 248 | 249 | def __lt__(self, other): 250 | try: 251 | if self.x == None or other.x == None: 252 | print('--Null Sofdot Detected--\n') 253 | 254 | return self.x < other.x 255 | 256 | except: 257 | raise TypeError("unsupported operand type(s) for <: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 258 | 259 | def __le__(self, other): 260 | try: 261 | if self.x == None or other.x == None: 262 | print('--Null Sofdot Detected--\n') 263 | 264 | return self.x <= other.x 265 | 266 | except: 267 | raise TypeError("unsupported operand type(s) for <=: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 268 | 269 | def __ge__(self, other): 270 | try: 271 | if self.x == None or other.x == None: 272 | print('--Null Sofdot Detected--\n') 273 | 274 | return self.x >= other.x 275 | 276 | except: 277 | raise TypeError("unsupported operand type(s) for >=: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 278 | 279 | def __gt__(self, other): 280 | try: 281 | if self.x == None or other.x == None: 282 | print('--Null Sofdot Detected--\n') 283 | 284 | return self.x > other.x 285 | 286 | except: 287 | raise TypeError("unsupported operand type(s) for >: 'Sofdot' and '{}'".format(str(type(other))[8:-2])) 288 | 289 | #number = Sofdot(1234567890) 290 | #null = Sofdot(None) 291 | # 292 | #number.plot() 293 | #null.plot() --------------------------------------------------------------------------------