Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. Python: 2.7.3
  2.  
  3. Flask: 0.9
  4.  
  5. from __future__ import with_statement
  6. from flask import Flask, request, session, g, redirect, url_for,
  7. abort, render_template, flash, views
  8. from sqlite3 import dbapi2 as sqlite3
  9. from contextlib import closing
  10. from apscheduler.scheduler import Scheduler
  11.  
  12. sched = Scheduler()
  13. sched.add_interval_job(moveAllCars, seconds = 5)
  14. sched.start()
  15.  
  16. def moveAllCars():
  17. print "debug 1"
  18. dbCommand = g.db.execute('SELECT CarID FROM Car')
  19. print "debug 2"
  20. #and so on
  21.  
  22. from os import getcwd
  23. import logging
  24. logging.basicConfig(
  25. filename=''.join([getcwd(), '/', 'log_file_name']),
  26. level=logging.DEBUG,
  27. format='%(levelname)s[%(asctime)s]: %(message)s'
  28. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement