Hi
I am new to python and would like to get a small function to accept 2 variables and then execute a small function in a pyqt5 window. I have read two books and still can't do it. Here is the code I am trying to run. It is for a lotto quick picker using the Random library.
The program takes in input x and uses it to create the range of how many numbers the program picks and then the y variable (both integers) is the maximum number to select up to. so 6 and 49 would mean six numbers out of 49 total, a common lottery. If it's possible and easy adding in some code to not pick the same number twice would be nice as well. I have had success with this program online in casinos so I am really keen on making it run in its own GUI
I am new to python and would like to get a small function to accept 2 variables and then execute a small function in a pyqt5 window. I have read two books and still can't do it. Here is the code I am trying to run. It is for a lotto quick picker using the Random library.
import random print('Bills Lucky Quick Picker') print('how many numbers') x = int(input()) print('how many spots') y = int(input()) for i in range(x): print(random.randint(1,y))I would like a pyqt5 window to accept the two variables x and y and then run the for loop to print out the results within the window. I can get a window to run that function but it displays in the idle, not the GUI.
The program takes in input x and uses it to create the range of how many numbers the program picks and then the y variable (both integers) is the maximum number to select up to. so 6 and 49 would mean six numbers out of 49 total, a common lottery. If it's possible and easy adding in some code to not pick the same number twice would be nice as well. I have had success with this program online in casinos so I am really keen on making it run in its own GUI
Larz60+ write Jan-30-2022, 02:08 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBcode tags on funture posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBcode tags on funture posts.