File: mainwindow.py

package info (click to toggle)
ponyprog 3.1.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,904 kB
  • sloc: cpp: 35,932; python: 981; sh: 565; xml: 67; makefile: 45; ansic: 38
file content (23 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
from PyQt5 import QtWidgets
from qhexedit import QHexEdit


class HexEdit(QHexEdit):

    def __init__(self, fileName=None):
        super(HexEdit, self).__init__()
        file = open(fileName, 'rb')
        data = file.read()
        self.setData(data)
        self.setReadOnly(False)

        
if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    mainWin = HexEdit('mainwindow.py')
    mainWin.resize(600, 400)
    mainWin.move(300, 300)
    mainWin.show()
    sys.exit(app.exec_())