title: How to run a Python file with boolean arguments
body: <p>I have a .py file with a single function that basically converts a .csv file to a .pkl file. This file, when invoked from the terminal, is supposed to convert the measurements between imperial and metrics depending on whether the input is true or not. For example</p>
  <p><code>python3 file.py imperial_units=True</code> or <code>python3 file.py imperial_units=False</code> and if there are no arguments provided like <code>python3 file.py</code>, imperial units should just default to True:</p>
  <p>This is my attempt:</p>
  <pre><code>import json, sys
  import pandas as pd
  
  def log_to_pickle(units):
      ...
              
              if units == True: # If units == True, convert all metric to imperial
                  print('Imperial True')
                  if imperial_unit == False:
                      ...
  
              elif units == False: # If units == False, convert all imperial to metric
                  print('Imperial False')
                  if imperial_unit == True:
                      ...
  
              ...
  
  if __name__ == &quot;__main__&quot;:
      if sys.argv == True or sys.argv == '':
          log_to_pickle(True)
      else:
          log_to_pickle(False)
  </code></pre>
  <p>I've added the print statements inside the if/elif block to see whether my inputs work. I ran <code>python3 file.py imperial_units=True</code> and the output was <code>'Imperial False'</code></p>
  <p>What am I doing wrong?</p>