'--flux', type=bool, help='Get the fluxes from the files (True or False)', required=False, default=True) parser.add_argument( '-c', '--conditions', type=bool, help='Get the conditions from the files (True or False)', required=False, default=False) args = parser.parse_args() db = Database("test1.db") db.fill_visits(args.path, args.filter, args.flux, args.conditions) db2 = DataDatabase("test2.db", first=False) db2.fill_visits(args.path, args.filter, args.flux, args.conditions) fluxes1 = db.get_flux_list() fluxes2 = db2.get_flux_list() import pdb pdb.set_trace() assert np.allclose(fluxes1, fluxes2, rtol=0.15), "New fluxes do not match pyregion fluxes:" \ "\nPyregion: %s\n " \ "New: %s" \ % (str(fluxes1), str(fluxes2))
if (self.mytview.viewchoice=='p'): for key in userdic[self.mytview.username].stockdic: print ("stockname : "+userdic[self.mytview.username].stockdic[key].stockname) print ("stock shares : "+str(userdic[self.mytview.username].stockdic[key].shares)) elif (self.mytview.viewchoice=='ae'): print (userdic[self.mytview.username].amountearn) elif (self.mytview.viewchoice=='al'): print (userdic[self.mytview.username].amountloss) elif (self.mytview.viewchoice=='l'): print (userdic[self.mytview.username].liquidcash()) tdatabase=Database('ttrader') ''' tdatabase.connect() tdatabase.cursor() tdatabase.curs.execute("CREATE TABLE 'Transactions' ('id' INTEGER,'Username' VARCHAR,'Transaction_Type' VARCHAR, 'Stockname' VARCHAR, 'Transaction_Shares' INTEGER, 'Transaction_Amount' REAL, 'Transaction_Stock_Price' REAL, 'Transaction_Time' TEXT, PRIMARY KEY ('id'))") tdatabase.curs.execute("CREATE TABLE 'Portfolio'('id' INTEGER,'Username' VARCHAR,'Stockname' VARCHAR, 'Stock_Shares' INTEGER, PRIMARY KEY ('id'))") tdatabase.commit() tdatabase.close_connection() ''' ''' else: tdatabase.connect() tdatabase.cursor()