title: How to compare request.get result in if else statement
body: <p>I am making a new script which will take as input list of Ethereum private keys and produce the corresponding addresses with balances, and save the balance in the file if it's found along with private key and the address.</p>
  
  <p>Now, I'm almost certain that my problem lies within the conditional, but cannot figure it out.</p>
  
  <p>Script steps:
   1. Take file of private keys as input (-i flag)
   2. Convert them to public addresses/decode them
   3. Trigger an API call to Etherscan for the information about the address
   4. If the json()["result"] > 0 in API call, write it in output file (-o flag), else print out and sleep for 1 second</p>
  
  <p><a href="https://i.stack.imgur.com/ZP7FZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZP7FZ.png" alt="enter image description here"></a></p>
  
  <p>Can anyone give a heads up on where I am making mistake?</p>
  
  <p>My code:</p>
  
  <pre><code>#!/usr/bin/python
  import sys, os, argparse, requests, ethereum, binascii, time
  from multiprocessing import Pool
  
  def scanether(balance):
      try:
          # Convert private key to address and print the result
          eth_address = ethereum.utils.privtoaddr(INPUTFILE)
          eth_address_hex = binascii.hexlify(eth_address).decode("utf-8")
          eth_balance = requests.get("https://api.etherscan.io/api?module=account&amp;action=balance&amp;address=0x" + eth_address_hex + "&amp;tag=latest&amp;apikey=APIKEYHERE").json()["result"]
  
          # Check if the result is &gt; 0
          if ('result' != 0) in r.eth_balance: 
              print("[*] Address with balance found: " + eth_address_hex + priv)
              # Write match to OUTPUTFILE
              fHandle = open(OUTPUTFILE,'a')
              fHandle.write(eth_address_hex + privkey + "\n")
              fHandle.close()
          else:
              print("balance: {} address: 0x{} privkey: {}".format(float(eth_balance)/100000000, eth_address_hex, priv))
              time.sleep(1)
  
  
      except Exception as e:
          return
  
  if __name__ == '__main__':
      print("""
  # Finding the Ethereum address with balance
          """)
      # Parse arguments
      parser = argparse.ArgumentParser()
      parser.add_argument('-i', '--inputfile', default='input.txt', help='input file')
      parser.add_argument('-o', '--outputfile', default='output.txt', help='output file')
      parser.add_argument('-t', '--threads', default=200, help='threads')
      args = parser.parse_args()
  
      INPUTFILE=args.inputfile
      OUTPUTFILE=args.outputfile
      MAXPROCESSES=int(args.threads)
  
      try:
          addresses = open(INPUTFILE, "r").readlines()
      except FileNotFoundError as e:
          print(e)
          exit(e.errno)
  
      print("Scan in progress...")
      pool = Pool(processes=MAXPROCESSES)
      pool.map(scanether, addresses)
      print("Scan finished.")
  </code></pre>
  
  <p>The output is below:
  <a href="https://i.stack.imgur.com/bNvhq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bNvhq.png" alt="enter image description here"></a></p>