QtSimpleWidgets Adiciona Novos ao PyQt5
Project description
QSimpleWidgets
Um Sistema que traz um QWidget Para Edição de Codigo
Exemplo de codigo de Editor Basico usando o QSimpleWidgets
from QSimpleWidgets import QCodeEdit,QSetStyles
# Configurações do Editor
STYLES = {
'keyword': QSetStyles(255, 0, 157),
'operator': QSetStyles(255, 0, 157,"bold"),
'brace': QSetStyles(255,255,255),
'string': QSetStyles(255, 238, 0),
'comment': QSetStyles(90,90,90),
'numbers': QSetStyles(132, 0, 255),
}
# Palavras resevadas
keywords = [
'and', 'assert', 'break', 'class', 'continue', 'def',
'del', 'elif', 'else', 'except', 'exec', 'finally',
'for', 'from', 'global', 'if', 'import', 'in',
'is', 'lambda', 'not', 'or', 'pass', 'with',
'raise', 'return', 'try', 'while', 'yield',
'None', 'True', 'False',
]
# Python Operadores
operators = [
'=',
# Comparadores
'==', '!=', '<', '<=', '>', '>=',
# Aritimeticos
'\+', '-', '\*', '/', '//', '\%', '\*\*',
# Outros
'\+=', '-=', '\*=', '/=', '\%=',
# Outros
'\^', '\|', '\&', '\~', '>>', '<<',
]
# Outros
braces = [
'\{', '\}', '\(', '\)', '\[', '\]',
]
class PythonCodeEditor(QMainWindow):
def __init__(self):
super().__init__()
self.view = QCodeEdit(self,STYLES,keywords,operators,braces)
self.view.keywordColor.SetNewKeywordColor("self",SetStyles(255,0,255,"bold")) # Colorca um cor em um keyword
self.setCentralWidget(self.view)
App = QApplication([])
editor = PythonCodeEditor()
editor.show()
App.exec()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
QSimpleWidgets-0.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for QSimpleWidgets-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79b75a2e2a548aa0eeae7efe38d2944ed26361b57605be21aded4bcb7ae61f20 |
|
MD5 | 18545494c8978f15433d2fd6bbd9990d |
|
BLAKE2b-256 | 50795d90fd2dc94f96d969993f6ac917ac1c3224c3fb2b66acbbbf1d7be9f9f8 |