import twstock


def main(argv):
    print('四大買賣點判斷 Best Four Point')
    print('------------------------------')
    if len(argv) > 1:
        sids = argv[1:]
        for sid in sids:
            bfp = twstock.BestFourPoint(twstock.Stock(sid))
            bfp = bfp.best_four_point()
            print('%s: ' % (sid), end='')
            if bfp:
                if bfp[0]:
                    print('Buy  ', bfp[1])
                else:
                    print('Sell ', bfp[1])
            else:
                print("Don't touch")

import twstock


def run(argv):
    print('四大買賣點判斷 Best Four Point')
    print('------------------------------')
    for sid in argv:
        bfp = twstock.BestFourPoint(twstock.Stock(sid))
        bfp = bfp.best_four_point()
        print('%s: ' % (sid), end='')
        if bfp:
            if bfp[0]:
                print('Buy  ', bfp[1])
            else:
                print('Sell ', bfp[1])
        else:
            print("Don't touch")

Fix best four point cli
Fix best four point cli

  import twstock
  
  
- def main(argv):
+ def run(argv):
      print('四大買賣點判斷 Best Four Point')
      print('------------------------------')
+     for sid in argv:
-     if len(argv) > 1:
-         sids = argv[1:]
-         for sid in sids:
-             bfp = twstock.BestFourPoint(twstock.Stock(sid))
+         bfp = twstock.BestFourPoint(twstock.Stock(sid))
-             bfp = bfp.best_four_point()
+         bfp = bfp.best_four_point()
-             print('%s: ' % (sid), end='')
+         print('%s: ' % (sid), end='')
+         if bfp:
-             if bfp:
+             if bfp[0]:
-                 if bfp[0]:
-                     print('Buy  ', bfp[1])
+                 print('Buy  ', bfp[1])
-                 else:
-                     print('Sell ', bfp[1])
              else:
+                 print('Sell ', bfp[1])
+         else:
-                 print("Don't touch")
+             print("Don't touch")
  
Fix best four point cli
## Code Before:
import twstock


def main(argv):
    print('四大買賣點判斷 Best Four Point')
    print('------------------------------')
    if len(argv) > 1:
        sids = argv[1:]
        for sid in sids:
            bfp = twstock.BestFourPoint(twstock.Stock(sid))
            bfp = bfp.best_four_point()
            print('%s: ' % (sid), end='')
            if bfp:
                if bfp[0]:
                    print('Buy  ', bfp[1])
                else:
                    print('Sell ', bfp[1])
            else:
                print("Don't touch")

## Instruction:
Fix best four point cli
## Code After:
import twstock


def run(argv):
    print('四大買賣點判斷 Best Four Point')
    print('------------------------------')
    for sid in argv:
        bfp = twstock.BestFourPoint(twstock.Stock(sid))
        bfp = bfp.best_four_point()
        print('%s: ' % (sid), end='')
        if bfp:
            if bfp[0]:
                print('Buy  ', bfp[1])
            else:
                print('Sell ', bfp[1])
        else:
            print("Don't touch")
