I'm trying to make an app that can automate an Instagram page, and I have the script for the program ready, but just need to implement it into a GUI. For this, I'm using Kivy. However, I only need to send one request to the API for this. When I click on a button, it triggers the command attached to on_release of the button twice. How can I fix this?
Simplified Python Script:
from kivymd.app import MDApp
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.lang import Builder
class StartScreen(Screen):
pass
class WindowManager(ScreenManager):
pass
class BruhApp(MDApp):
def build(self):
self.root = Builder.load_file("bruh.kv")
if __name__ == '__main__':
BruhApp().run()
.kv File:
WindowManager:
StartScreen:
<StartScreen>:
name: "start"
FloatLayout:
MDLabel:
text: "Welcome to the Instagram Page Automator!"
font: "RobotoThin"
font_style: "H5"
halign: "center"
size_hint:0.9,0.7
color: 0,0,0,0.5
pos_hint:{"center_x":0.5,"y":0.5}
MDFillRoundFlatButton:
md_bg_color: 0, 1, 0.6, 1
text:"Continue"
font: "RobotoThin"
size_hint:0.4,0.07
pos_hint:{"center_x":0.5,"y":0.1}
on_release:
print("yes")
This script prints "Yes" twice for me everytime I press the button.