Skip to content

Instantly share code, notes, and snippets.

@PaulleDemon
PaulleDemon / Resize_CanvasItems.py
Last active August 26, 2021 07:16
This is an example on how to resize canvas items by dragging the corner in tkinter.
# MIT License
#
# Copyright (c) 2021 Paul
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@PaulleDemon
PaulleDemon / Speech_to_text.py
Last active July 20, 2021 10:25
PyQt/PySide with speech_recognition
# MIT License
#
# Copyright (c) 2021 Paul
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@PaulleDemon
PaulleDemon / PyQtLabelExample.py
Last active October 26, 2021 06:26
Contanins PyQt Label example
import sys
from PyQt5.QtWidgets import QApplication, QLabel
if __name__ == '__main__':
app = QApplication(sys.argv)
label = QLabel("Sample label")
label.show()
@PaulleDemon
PaulleDemon / PyQtButtonExample.py
Created October 26, 2021 06:31
Contains PyQt example of Button and label
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton
if __name__ == '__main__':
app = QApplication(sys.argv)
widget = QWidget()
@PaulleDemon
PaulleDemon / PyQtlayout_example.py
Created October 26, 2021 06:33
PyQt layout example
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout
if __name__ == '__main__':
app = QApplication(sys.argv)
widget = QWidget()
@PaulleDemon
PaulleDemon / PyQtSignalslotexample.py
Last active October 26, 2021 13:27
This is an example of signal and slot in pyqt
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout
def change_button_text():
button.setText("Button has been clicked")
if __name__ == '__main__':
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout
def change_button_text():
button.setText("Button has been clicked")
if __name__ == '__main__':
import sys
from PyQt5.QtWidgets import QApplication, QLabel
from PyQt5.QtGui import QFont, QPalette, QColor
if __name__ == '__main__':
app = QApplication(sys.argv)
label = QLabel("hello")
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout
_style = """
QWidget{
background-color: #f5fbff;
}
QLabel{
color: black;
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout
def change_button_text():
button.setText("Button has been clicked")
if __name__ == '__main__':
app = QApplication(sys.argv)