def run_app(filename): # Read the data from the input file data = read_file(filename) # Get the data separated plateau, deployment, movements = process_data(data) # Create a storage for the data storage = Storage(plateau, deployment, movements) # Create the rovers and display input data print("---------------------------") print(" INPUT ") print("---------------------------") ctrl.init(storage) # Move the rovers ctrl.run(storage) # Print the output data print("---------------------------") print(" OUTPUT ") print("---------------------------") ctrl.print_positions()
from app import controller if __name__ == "__main__": controller.run()
from app.controller import run import os # what's going on here is # get the file path to the directory containing this python file # declare the name of our data file # construct a path that is our base directory joined with our file name BASE_DIRECTORY = os.path.dirname(__file__) filename = "tellerdata.json" filepath = os.path.join(BASE_DIRECTORY, filename) run(filepath)
import os from app.account import Account from app.position import Position from app.trade import Trade from app.controller import run import bcrypt import requests # from app import ORM DIR = os.path.dirname(__file__) DBFILENAME = 'trader.db' DBPATH = os.path.join(DIR, 'data', DBFILENAME) print(DBPATH) Account.dbpath = DBPATH Position.dbpath = DBPATH Trade.dbpath = DBPATH run()