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 details)
Built Distribution
File details
Details for the file QSimpleWidgets-0.1.tar.gz
.
File metadata
- Download URL: QSimpleWidgets-0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7c2d301770521be03f51601c5250875377956a3c1f84d840f95fdfd66ed31b |
|
MD5 | 14e48ee6a2b56b258cd3331df2d83af6 |
|
BLAKE2b-256 | ece6661d0240d2e64e77a66f9c0340c934311e7a2ea02192fb2cc65e8ee6a644 |
File details
Details for the file QSimpleWidgets-0.1-py3-none-any.whl
.
File metadata
- Download URL: QSimpleWidgets-0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79b75a2e2a548aa0eeae7efe38d2944ed26361b57605be21aded4bcb7ae61f20 |
|
MD5 | 18545494c8978f15433d2fd6bbd9990d |
|
BLAKE2b-256 | 50795d90fd2dc94f96d969993f6ac917ac1c3224c3fb2b66acbbbf1d7be9f9f8 |