Skip to main content

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()

Release files for QSimpleWidgets 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QSimpleWidgets 0.1
File Size Uploaded
QSimpleWidgets-0.1.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for QSimpleWidgets 0.1
File Interpreter ABI Platform
QSimpleWidgets-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / QSimpleWidgets-0.1.tar.gz

Download URL QSimpleWidgets-0.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ce7c2d301770521be03f51601c5250875377956a3c1f84d840f95fdfd66ed31b
BLAKE2b-256 checksum
How to use checksums
ece6661d0240d2e64e77a66f9c0340c934311e7a2ea02192fb2cc65e8ee6a644
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / QSimpleWidgets-0.1-py3-none-any.whl

Download URL QSimpleWidgets-0.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79b75a2e2a548aa0eeae7efe38d2944ed26361b57605be21aded4bcb7ae61f20
BLAKE2b-256 checksum
How to use checksums
50795d90fd2dc94f96d969993f6ac917ac1c3224c3fb2b66acbbbf1d7be9f9f8
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page