Go to advanced search

by razor23
Fri Oct 02, 2020 11:38 am
Forum: Python
Topic: Using subtraction on variables
Replies: 6
Views: 288

Re: Using subtraction on variables

That approach might just work ;) , thank you for the idea. Will post after implementing.
by razor23
Thu Oct 01, 2020 7:51 pm
Forum: Python
Topic: Using subtraction on variables
Replies: 6
Views: 288

Re: Using subtraction on variables

Yes, but if i use -= it raises syntax error and points to = sign Really? Try x = x - 5 instead To tell you thruth, i have a list, that is filled with input numbers (darts game), and i want to display substractions of 501 or any other game when a user inputs (hits) number, it get stored in the list....
by razor23
Thu Oct 01, 2020 7:41 pm
Forum: Python
Topic: Using subtraction on variables
Replies: 6
Views: 288

Re: Using subtraction on variables

Is this what you want ? Python 3.8.5 (default, Aug 1 2020, 10:14:08) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> x = 10 >>> x -= 5 >>> x 5 >>> x -= 3 >>> x 2 >>> You can run Python interactively (as here) t...
by razor23
Thu Oct 01, 2020 7:11 pm
Forum: Python
Topic: Using subtraction on variables
Replies: 6
Views: 288

Using subtraction on variables

Hello I have a list that gets filled with integers as a user press a button. I want to make a default number like 10, and then tell program to substract from 10, number that user pressed, and next i want to substract from that substracted number, but all i seem to get is substracting from 10 all ove...
by razor23
Fri Sep 25, 2020 12:03 pm
Forum: Python
Topic: Threading on rasberry using GUI (simplePYGui)
Replies: 12
Views: 522

Re: Threading on rasberry using GUI (simplePYGui)

I have figured it out, it now works, and i can pull data from matrix.

Now goes the hard part, wish me luck :)
by razor23
Wed Sep 23, 2020 7:00 pm
Forum: Python
Topic: Threading on rasberry using GUI (simplePYGui)
Replies: 12
Views: 522

Re: Threading on rasberry using GUI (simplePYGui)

This is my matrix for reading input from GPIO, and it works, i mean it "prints" numbers in console. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(14, GPIO.OUT) matrix = [5, 12, 20, 9, 1, 14, 18, 11, 6, 7, 10, 19, 15, 3, 2, 17, 8, 16, 4, 13] C...
by razor23
Wed Sep 23, 2020 11:32 am
Forum: Python
Topic: Threading on rasberry using GUI (simplePYGui)
Replies: 12
Views: 522

Re: Threading on rasberry using GUI (simplePYGui)

I'd probably run the matrix code on a separate thread. Less likely to miss a keypress event. My thoughts exactly, but i dont know how to start a thread in my main GUI. I will post matrix code once i get home. I dont think i did it as i supposed, app is starting, no errors but i dont know if its a t...
by razor23
Wed Sep 23, 2020 7:44 am
Forum: Python
Topic: Threading on rasberry using GUI (simplePYGui)
Replies: 12
Views: 522

Re: Threading on rasberry using GUI (simplePYGui)

Keep long running lopps away from GUI code. You could set up a timer callback Maybe this helps: https://www.pythonpool.com/python-timer/ To get the result back to the GUI code maybe look at queues: https://stackoverflow.com/questions/14508906/sending-messages-between-class-threads-python But it may...
by razor23
Wed Sep 23, 2020 6:50 am
Forum: Python
Topic: Threading on rasberry using GUI (simplePYGui)
Replies: 12
Views: 522

Threading on rasberry using GUI (simplePYGui)

Hello fellow programers I am new to python and i have a Rasberry PI 4 , 2 GB. I am building a button matrix with 80 buttons, (matrix style is 8x12) and want to implement to work with GUI. Matrix is in WHILE loop and if i put it anywhere in program, program is not responding, it stays in matrix loop....

Go to advanced search