KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
Website-v2
★ 10
Open GitHub ↗
Teste test
Download README (.md)
Explore Similar Repositories
Smart_CV
:
AI-powered resume builder — paste a job description to optimize bullets with ATS keywords, choose from 9 styles, import PDFs, and export pixel-perfect A4. Runs entirely in your browser with your own API key.
InterviewPilot
:
把“简历 + 面试录屏 + 知识库”转成可执行复盘结果:真实问答、分析报告、模拟面试。
rednote-hackthon-opendoll
:
开源人形 OPENDOLL|为每个硅基生命创造属于自己的可爱面孔
shardofthedragon
:
Fun web projects
pg-ripple
:
A high-performance RDF triple store implemented as a native PostgreSQL 18+ extension.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
Website-v2
?
Download (.md)
========================================================== PROJETO COMPLETO: Qt + Flask + HTML + CSS + JavaScript ========================================================== DESCRIÇÃO: - Janela Qt (PyQt5) - Servidor Flask integrado - Página Web dinâmica - Leitura de ficheiros .txt - Escolher caminhos - Botões: Ligar / Desligar / Sair - Menu com opções de edição - Modo Professor (explicações no código) ========================================================== ====================== IMPORTS ====================== import sys import threading from flask import Flask, render_template_string, jsonify from PyQt5.QtWidgets import ( QApplication, QMainWindow, QPushButton, QFileDialog, QVBoxLayout, QWidget, QLabel, QLineEdit, QTextEdit, QAction ) ====================== FLASK APP ====================== app = Flask(name) Variável global para guardar o texto texto_global = "" ====================== HTML DINÂMICO ====================== HTML_PAGE = """ <!DOCTYPE html><html> <head> <title>Viewer Dinâmico</title> <style> body { font-family: Arial; background: #1e1e1e; color: white; text-align: center; } textarea { width: 80%; height: 300px; margin-top: 20px; background: #2e2e2e; color: #00ffcc; font-size: 16px; } </style> </head> <body> <h1>Modo Professor - Visualização Dinâmica</h1><textarea id="caixa"></textarea> <script> async function atualizarTexto() { const resposta = await fetch('/texto'); const dados = await resposta.json(); document.getElementById('caixa').value = dados.texto; } setInterval(atualizarTexto, 1000); </script> </body> </html> """====================== ROTAS FLASK ====================== @app.route('/') def index(): return render_template_string(HTML_PAGE) @app.route('/texto') def get_texto(): return jsonify({'texto': texto_global}) ====================== THREAD FLASK ====================== def run_flask(): app.run(port=5000) ====================== JANELA QT ====================== class MainWindow(QMainWindow): def init(self): super().init() self.setWindowTitle("Servidor Qt + Flask") self.setGeometry(100, 100, 600, 400) # ====================== # COMPONENTES # ====================== self.label = QLabel("Caminho do ficheiro:") self.path_input = QLineEdit() self.btn_abrir = QPushButton("Escolher TXT") self.btn_ligar = QPushButton("Ligar Servidor") self.btn_desligar = QPushButton("Desligar") self.btn_sair = QPushButton("Sair") self.log = QTextEdit() # ====================== # LAYOUT # ====================== layout = QVBoxLayout() layout.addWidget(self.label) layout.addWidget(self.path_input) layout.addWidget(self.btn_abrir) layout.addWidget(self.btn_ligar) layout.addWidget(self.btn_desligar) layout.addWidget(self.btn_sair) layout.addWidget(self.log) container = QWidget() container.setLayout(layout) self.setCentralWidget(container) # ====================== # MENU # ====================== menu = self.menuBar() file_menu = menu.addMenu("Ficheiro") abrir_action = QAction("Abrir TXT", self