<gh_stars>1-10
import quickfix
import sys

print(sys.argv)
if len(sys.argv) < 2: 
    sys.exit()
fileName = sys.argv[1]

try:
    settings = quickfix.SessionSettings(fileName)
    application = quickfix.Application()
    storeFactory = quickfix.FileStoreFactory(settings)
    logFactory = quickfix.FileLogFactory(settings)
    acceptor = quickfix.SocketAcceptor(application, storeFactory, settings, logFactory)
    acceptor.start()
    # while condition == true: do something
    acceptor.stop()
except quickfix.ConfigError as e:
        print(e)
import quickfix
import sys

print(sys.argv)
if len(sys.argv) < 2: 
    sys.exit()
fileName = sys.argv[1]

try:
    settings = quickfix.SessionSettings(fileName)
    application = quickfix.Application()
    storeFactory = quickfix.FileStoreFactory(settings)
    logFactory = quickfix.FileLogFactory(settings)
    acceptor = quickfix.SocketAcceptor(application, storeFactory, settings, logFactory)
    acceptor.start()
    # while condition == true: do something
    acceptor.stop()
except quickfix.ConfigError as e:
        print(e)
# while condition == true: do something