def tradeDataStore(): table_name = db_table_name db_conn = db.dbConnect(stock_db) table_create_cmd = "CREATE TABLE " + table_name + " (TIME CHARACTER(20), PRICE FLOAT, VOLUME_INC INT, TRADE_TYPE INT);" db.dbCreateTable(db_conn, table_name, table_create_cmd) tradeItemStore(stock_code, db_conn, table_name) db.dbClose(db_conn) return
def on_actionKilepes_triggered(self): result = QMessageBox.question(self, "Kilépés megerősítése...", "Biztosan ki akar lépni az programból?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No) if result == QMessageBox.Yes: db.dbClose() self.close()
def tradeInfoQuery(): db_name = stock_db db_conn = db.dbConnect(stock_db) cursor = db_conn.cursor() cursor.execute("SELECT TIME, PRICE, VOLUME_INC from " + db_table_name) results = cursor.fetchall() db.dbClose(db_conn) for row in results: print "time: %s, price %f, volume %s" %(row[0], row[1], row[2])
print "OOOPs!!! there is an error!!!" resCapture( "Creating EC2 instances: {}".format(''.join( [P.resourceBase, ResSeparator, a])), exc) result = -1 return result # # using this to prevent the file from running if someone decides # to "import" this into their program # P = global_stuff() logging.getLogger('botocore').setLevel(logging.DEBUG) logging.getLogger('boto3').setLevel(logging.DEBUG) if __name__ == "__main__": result = -1 if db.dbOpen() == True: result = 0 if len(sys.argv) > 1: print "No arguments are supported by this application!" else: result = main() db.createOrchJournalEntry(P.custId, result, P.resText) db.dbClose() sys.exit(result)