Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python make a new window

from PyQt5.QtWidgets import QApplication, QWidget
import sys


class Window(QWidget):
    def __init__(self):
        super().__init__()





app = QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec_())
Comment

create a window in python

I`ve explaned it in detail over here 
			/
https://youtu.be/KfW3GzhyWUM
Comment

How To Make A Window Python

#Window Script
import tkinter as tk

root = tk.Tk()

canvas = tk.Canvas(root, height=600, width=1000, bg="#f0f0f0") #canvas set to #f0f0f0 to hide the canvas but change the scaling settings
canvas.pack()

frame = tk.Frame(root, bg="#f0f0f0") #f0f0f0 is the light gray default color for windows in windows 10/11
frame.place(relwidth=1.0, relheight=1.0, relx=0.1, rely=0.1) #auto center the canvas

root.mainloop()
#open with python instead of your code editor
Comment

PREVIOUS NEXT
Code Example
Python :: print % in python 
Python :: sort df by column 
Python :: how to get location using python 
Python :: python async await 
Python :: django link home page 
Python :: blinking an led with raspberry pi 
Python :: map object to array python 
Python :: python getting class name 
Python :: torchvision.transforms 
Python :: Issue Pandas TypeError: no numeric data to plot 
Python :: python os remove extension 
Python :: write text in list to text file python 
Python :: python folder exists 
Python :: ignoring warnings 
Python :: how to use with open 
Python :: detect keypress in python 
Python :: django sort descending 
Python :: python print for loop one line 
Python :: falsy values in python 
Python :: check if string has digits python 
Python :: how to read tuples inside lists python 
Python :: how do you see if a data type is an integer python 
Python :: pandas sort 
Python :: getting the file path of a file object in python 
Python :: pangram function 
Python :: how to load keras model from json 
Python :: python naming conventions 
Python :: how to import a python function from another file 
Python :: python 2d array to dataframe 
Python :: print textbox value in tkinter 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =