This is my first question in this forum. My Python level is probably between a beginner and a pre-intermediate. My major is not related to computer sciences; but I really like coding and I’m trying to develop myself, trying to code in my free times. I can do simple codes and write codes for special numbers (e.g. Harshad numbers, Kaprekar numbers etc.) I want to make simple applications/games, such as a calculator or tetris or blackjack etc. I can write codes as script but I need to learn GUI.
Currently, I’m trying to make a black jack game. Now, I have a “Shuffle” button. How can I modify it? I would like to change it’s appearance with a png I’ve downloaded a file from the internet (I’ve put the file in the same directory with the game file). Following code is the part of my code:
I made some progress and I’m able to add a label (png) and some buttons. Where I’m stuck right now is to draw a rectangle. I think it is supposed to be pretty easy but somehow I couldn’t manage program to display it on the screen. Here is the rectangle code (self.painter = QPainter(self) is under the class Main Window):