Button

  • Step 1:
    QPushButton()

    Create button

    
                  # Create a button in the window
                  self.button = QPushButton('Show text', self)
                  self.button.move(20,80)
                  

    Button click

    
                  self.button.clicked.connect(self.on_click)
                  

    click function

    
                  def on_click(self):
                      url = 'https://www.w3schools.com/python/demopage.php'
                      myobj = {'somekey': 'somevalue'}
                      x = requests.post(url, json = myobj)
                      print(x.text)