Skip to content

Commit 737a664

Browse files
committed
Update App.pyw
Correção de bugs
1 parent cc7a241 commit 737a664

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

App.pyw

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ScriptCad:
1111

1212
def criar(self):
1313
arq = open(r''+self.arquivo+'.scr', 'w')
14-
arq.writelines(f'_POLYLINE\n0,0\n')
14+
arq.writelines(f'_PLINE\n0,0\n')
1515
arq.close()
1616

1717

@@ -195,6 +195,12 @@ class Aplicacao(tk.Frame):
195195
self.container.forget()
196196
self.inicio()
197197

198+
def isnumber(self, value):
199+
try:
200+
float(value)
201+
except ValueError:
202+
return False
203+
return True
198204

199205
def proximo(self):
200206
teste_orientacoes = 'bad'
@@ -216,17 +222,16 @@ class Aplicacao(tk.Frame):
216222
teste_segundo = self.ensegundo.get().strip()
217223
teste_segundo = teste_segundo.replace(",",".")
218224

219-
if teste_segundo.isdecimal():
225+
if self.isnumber(teste_segundo) == True:
220226
segundo = float(teste_segundo)
221227
self.ensegundo['bg']=self.cor['Fonte']
222228
else:
223229
self.ensegundo['bg']=self.cor['ruim']
224230

225231
teste_distancia = self.endistancia.get().strip()
226-
227232
teste_distancia = teste_distancia.replace(",",".")
228233

229-
if teste_distancia.isdecimal():
234+
if self.isnumber(teste_distancia)== True:
230235
distancia = float(teste_distancia)
231236
self.endistancia['bg']=self.cor['Fonte']
232237
else:

0 commit comments

Comments
 (0)