def getMoney(customer): print("{} tries to withdrawl ${} at {}".format( customer.name, customer.moneyRequest, time.strftime("%H,%M,%S", time.gmttime()))) if BankAccount.acctBalance - customer.moneyRequest > 0: BankAccount.acctBalance -= customer.moneyRequest print("New account Balance:${}".format(BankAccount.acctBalance)) else: print("Not enought money in account") print("Current balance: ${}".format(BankAccount.acctBalance))
def init(): for channel in targetChannels: channelProfiles[channel.lower()] = list() server.send_raw("NAMES " + channel) print "Init run" try: conn = sqlite3.connect(activityDB) c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS activityLog (time int, nick text, channel text)''') #Delete all records older than 365d deletetime = int(time.gmttime()) - (365 * 24 * 60 * 60) c.execute('''DELETE FROM activitylog WHERE time <= %s''' % (deletetime)) conn.commit() conn.close() except: print traceback.format_exc() conn.rollback() conn.close() return
def init(): for channel in targetChannels: channelProfiles[channel.lower()] = list() server.send_raw("NAMES " + channel) print "Init run" try: conn = sqlite3.connect(activityDB) c = conn.cursor() c.execute( '''CREATE TABLE IF NOT EXISTS activityLog (time int, nick text, channel text)''' ) #Delete all records older than 365d deletetime = int(time.gmttime()) - (365 * 24 * 60 * 60) c.execute('''DELETE FROM activitylog WHERE time <= %s''' % (deletetime)) conn.commit() conn.close() except: print traceback.format_exc() conn.rollback() conn.close() return
def handlePubmsg(con, event): executeSQL('''INSERT INTO activitylog values(%s, "%s", "%s")''' % (int(time.gmttime()), event.source().split("!").lower(), event.target().lower())) return
import time print("Seconds elapsed since the epoch are : ") print(time.time()) print("Time calculated acc. to given seconds is : ") print time.gmtime() ti = time.gmttime() print time.acstime(ti) print time.ctime() print time.ctime() time.sleep(4) print time.ctime()