Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
  Exclamation Thread: Compare values in a for loop.
Post: Compare values in a for loop.

Hey! Im working on this code that get a list o templates and compare(OpenCV template matching) to a image searching for templates. The precision is set to 0.70 so search_image_in_image get THE FIRST...
penahuse General Coding Help 1 2,357 Feb-22-2021, 04:29 AM
    Thread: Integrate/import a gui code to my main.py
Post: RE: Integrate/import a gui code to my main.py

You're absolutly right. The simplegui was working but not properly.
penahuse General Coding Help 6 3,090 Feb-03-2021, 08:44 PM
    Thread: Integrate/import a gui code to my main.py
Post: RE: Integrate/import a gui code to my main.py

(Feb-03-2021, 07:45 PM)Axel_Erfurt Wrote: remove the bracket in line 35, unmatched Thank you! Any tips to integrate it to maind code "like" the pysimplegui based gui?
penahuse General Coding Help 6 3,090 Feb-03-2021, 07:48 PM
    Thread: Integrate/import a gui code to my main.py
Post: Integrate/import a gui code to my main.py

Hi, need some help here. I wrote a code that has a GUI base on pysimplegui. This gui was a class in my maincode.py: class TelaPython: def __init__(self): with open('./weapon_data/p...
penahuse General Coding Help 6 3,090 Feb-03-2021, 07:33 PM
    Thread: Is there a way to read the time between clicks?
Post: Is there a way to read the time between clicks?

Fellows, I need some help here. Im trying to do a code that read the time between lefts clicks while right buttom is pressed. If the clicking is slow it will do thing1. If meduim velocity thing 2 and ...
penahuse General Coding Help 1 2,479 Jan-30-2021, 08:51 PM
    Thread: Change variable value during a while loop?
Post: RE: Change variable value during a while loop?

(Nov-15-2020, 11:41 PM)bowlofred Wrote: Put your check (the GetAsyncKeyState call) into the loop as well. Make sure it has an else clause to set it back to 1 when the key is up. Thank you for answe...
penahuse General Coding Help 2 4,038 Nov-15-2020, 11:53 PM
    Thread: Change variable value during a while loop?
Post: Change variable value during a while loop?

Hi! Is there a way to hange variable value during a while loop? example: import win32api global x x = 1 if win32api.GetAsyncKeyState(0x70): x = 4 def lmb_down(): lmb_state = win32api.Get...
penahuse General Coding Help 2 4,038 Nov-15-2020, 11:24 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

Im wondering a scenario a lit bit more complex... is there a way to keep almost the same result, but instead of buttom1 + buttom3 + buttom2 (in this order) resulting "do some",a way to it results "do ...
penahuse General Coding Help 25 7,889 Jun-01-2020, 06:00 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(Jun-01-2020, 08:02 AM)DreamingInsanity Wrote: Difinitely not the best way of doing it, but, like always, this should work: isMPressed = False while True: while button1_pressed() and button2_pr...
penahuse General Coding Help 25 7,889 Jun-01-2020, 03:25 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 09:44 PM)Yoriz Wrote: Try the following do_some_first = False while True: do_some = button1_pressed() and button2_pressed() do_some2 = button3_pressed() if do_some and ...
penahuse General Coding Help 25 7,889 May-31-2020, 09:56 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 09:10 PM)DreamingInsanity Wrote: If this doesn't work I'm sorry I couldn't help! But although I keep saying, in theory this should work. import win32api def button1_pressed(): # Retu...
penahuse General Coding Help 25 7,889 May-31-2020, 09:22 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 08:22 PM)DreamingInsanity Wrote: (May-31-2020, 08:08 PM)penahuse Wrote: Mate, you almost got it.. now if button M is not pressed it do nothing but if the the M is pressed before bu...
penahuse General Coding Help 25 7,889 May-31-2020, 08:33 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 08:00 PM)DreamingInsanity Wrote: (May-31-2020, 07:08 PM)penahuse Wrote: Yes, Im using your code, its right: if I hold M without button 1 and button 2 its suposed to do nothing indeed...
penahuse General Coding Help 25 7,889 May-31-2020, 08:08 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 07:02 PM)DreamingInsanity Wrote: (May-31-2020, 05:44 PM)penahuse Wrote: Now it work like my old code: 1 - if user press "button1" and "button2" then "press button3" Its ok to me "do...
penahuse General Coding Help 25 7,889 May-31-2020, 07:08 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 05:39 PM)DreamingInsanity Wrote: I did some testing. If you use 'GetAsyncKeyState' it should work. 'GetAsyncKeyState' is basically 'isKeyPressed' so the moment you let go of a button, ...
penahuse General Coding Help 25 7,889 May-31-2020, 05:44 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 04:52 PM)DreamingInsanity Wrote: @penahuse Try this: def button1_pressed(): # Returns true if the left mouse button is pressed button1_state = win32api.GetKeyState(0x01) retu...
penahuse General Coding Help 25 7,889 May-31-2020, 05:02 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 04:22 PM)DreamingInsanity Wrote: In your function, you get the state of the button press. It can be an integer between 1 and 0 (pressed or not pressed). When you return it, to get a Tr...
penahuse General Coding Help 25 7,889 May-31-2020, 04:32 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 03:35 PM)Yoriz Wrote: button1_pressed = True button2_pressed = True button3_pressed = True button2_is_not_pressed = True while button1_pressed and button2_pressed: print('do some'...
penahuse General Coding Help 25 7,889 May-31-2020, 04:16 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: RE: [HELP] Nested conditional? double condition fo...

(May-31-2020, 03:00 PM)Yoriz Wrote: button1_pressed and button2_pressed must both be True before you press button 3. Thank you for your answer but i do not fully understand. English isnt my first la...
penahuse General Coding Help 25 7,889 May-31-2020, 03:19 PM
    Thread: [HELP] Nested conditional? double condition followed by another condition.
Post: [HELP] Nested conditional? double condition follow...

Im trying to learn python but struggling on this problem. I will be thankfull if anyone give me some help. while button1_pressed and button2_pressed: #no matter which one is pressed first to me do ...
penahuse General Coding Help 25 7,889 May-31-2020, 02:42 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020