From: PASCALE NOYRET Date: Tue, 11 Oct 2022 11:16:21 +0000 (+0200) Subject: QFont pour impression du dataframe pandas X-Git-Tag: merge_uncertainty_odysee_1210^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=39c0ca27bc42a8f8cd2b11e57cec8a97c893810b;p=tools%2Feficas.git QFont pour impression du dataframe pandas --- diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index ff585f47..3ae78b6e 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -30,7 +30,7 @@ import traceback from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog, QApplication, QSplitter, QLabel -from PyQt5.QtGui import QPalette +from PyQt5.QtGui import QPalette, QFont from PyQt5.QtCore import QProcess, QFileInfo, QTimer, Qt, QDir, QSize, QProcessEnvironment import traceback @@ -209,27 +209,27 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget): #-----------------------------------------------------------------------------------------------# def _viewTextExecute(self, txt, prefix, suffix, fichierExe=None, shell='sh', texteCommande=None): #----------------------------------------------------------------------------------------------# - self.w = ViewText( self.QWParent ) - self.w.setWindowTitle( "execution" ) - self.monExe=QProcess(self.w) + self.myWidget = ViewText( self.QWParent ) + self.myWidget.setWindowTitle( "execution" ) + self.myWidget.view.setFont(QFont("Monospace")) + self.monExe=QProcess(self.myWidget) pid=self.monExe.pid() if not fichierExe and txt : fichierExe = self.generateTempFilename(prefix, suffix = ".sh") - f=open(fichierExe,'w') + f=open(fichierExe,'self.myWidget') f.write(txt) f.close() self.monExe.readyReadStandardOutput.connect( self.readFromStdOut) self.monExe.readyReadStandardError.connect( self.readFromStdErr) if texteCommande != None : exe=texteCommande else : exe=shell + ' ' + fichierExe - print (exe) monEnv=QProcessEnvironment.systemEnvironment() monEnv.insert('COLUMNS','500') self.monExe.setProcessEnvironment(monEnv) self.monExe.start(exe) self.monExe.closeWriteChannel() - self.w.exec_() + self.myWidget.exec_() if self.monExe!=None: self.monExe.readyReadStandardOutput.disconnect() self.monExe.readyReadStandardError.disconnect() @@ -240,15 +240,16 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget): def readFromStdErr(self): a=self.monExe.readAllStandardError() - chaine = str(a.data(), encoding="utf-8").rstrip() - self.w.view.append(chaine) - #self.w.view.append(str(a.data())) + chaine = str(a.data(), encoding="utf-8") + self.myWidget.view.append(chaine) + self.myWidget.view.append(chaine) + #self.myWidget.view.append(str(a.data())) def readFromStdOut(self) : a=self.monExe.readAllStandardOutput() - chaine = str(a.data(), encoding="utf-8").rstrip() - self.w.view.append(chaine) - # self.w.view.append(str(a.data())) + chaine = str(a.data(), encoding="utf-8") + self.myWidget.view.append(chaine) + # self.wmyWidget.view.append(str(a.data())) #-----------------------# @@ -948,6 +949,7 @@ class JDCEditor(JDCEditorSsIhm,Ui_baseWidget,QWidget): if not sauvegarde : return 0 #texteCommande=' export COLUMNS=200;' texteCommande =' /home/A96028/salome/appli_V9_7_0_sysVersion/salome start -k -t python3 ' + self.generator.fichierUQExe + #texteCommande =' /home/A96028/salome/appli_V9_7_0_sysVersion/salome start -k -t python3 /home/A96028/QT5Dev/eficasRN/ReacteurNumerique/essaiPanda.py' #self._viewTextExecute(None,None,None, fichierExe=self.generator.fichierUQExe, shell='python3') #self._viewTextExecute('ls -l /tmp','essaiLs','.sh',) #self._viewTextExecute(None,None,None, fichierExe='/home/A96028/QT5Dev/eficasRN/ReacteurNumerique/a.py',shell='python3',)