mirror of
https://github.com/shizand/statapp.git
synced 2025-04-03 16:13:44 +03:00
fix: Maks1m_s исправил ошибки (Code woth me)
This commit is contained in:
parent
3552e93dde
commit
de77ea6bfc
@ -120,18 +120,6 @@ class MainWindow(QMainWindow):
|
|||||||
msgBox.setStandardButtons(buttons)
|
msgBox.setStandardButtons(buttons)
|
||||||
msgBox.setDefaultButton(defaultButton)
|
msgBox.setDefaultButton(defaultButton)
|
||||||
|
|
||||||
if msgBox.button(QMessageBox.Yes) is not None:
|
|
||||||
msgBox.button(QMessageBox.Yes).setText("Да")
|
|
||||||
|
|
||||||
if msgBox.button(QMessageBox.No) is not None:
|
|
||||||
msgBox.button(QMessageBox.No).setText("Нет")
|
|
||||||
|
|
||||||
if msgBox.button(QMessageBox.Ok) is not None:
|
|
||||||
msgBox.button(QMessageBox.Ok).setText("Ок")
|
|
||||||
|
|
||||||
if msgBox.button(QMessageBox.Cancel) is not None:
|
|
||||||
msgBox.button(QMessageBox.Cancel).setText("Отмена")
|
|
||||||
|
|
||||||
return msgBox
|
return msgBox
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
|
@ -8,7 +8,7 @@ class FileSLCModel:
|
|||||||
self.file_name = None
|
self.file_name = None
|
||||||
|
|
||||||
def saveFile(self, data):
|
def saveFile(self, data):
|
||||||
if self.file_name is None:
|
if not self.file_name:
|
||||||
self.file_name, _ = QFileDialog.getSaveFileName(None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)")
|
self.file_name, _ = QFileDialog.getSaveFileName(None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)")
|
||||||
if self.file_name:
|
if self.file_name:
|
||||||
np.savetxt(self.file_name, data, delimiter=",")
|
np.savetxt(self.file_name, data, delimiter=",")
|
||||||
@ -17,7 +17,7 @@ class FileSLCModel:
|
|||||||
|
|
||||||
def loadFile(self):
|
def loadFile(self):
|
||||||
self.file_name, _ = QFileDialog.getOpenFileName(None, "Загрузить файл", "", "Files (*.txt;*.csv)")
|
self.file_name, _ = QFileDialog.getOpenFileName(None, "Загрузить файл", "", "Files (*.txt;*.csv)")
|
||||||
if self.file_name:
|
if not self.file_name:
|
||||||
try:
|
try:
|
||||||
content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True)
|
content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user