Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
SmartBoat-V2/SystemLibrary.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
17 lines (14 sloc)
636 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, socket, datetime, os, fcntl, struct, sqlite3 #import time, IP, time and date | |
from flask import Flask, render_template, request, jsonify, request, send_file #import web app | |
from w1thermsensor import W1ThermSensor | |
import RPi.GPIO as GPIO | |
import netifaces as ni | |
def get_IP(): | |
'''Automatically gets the IP address of the Pi''' | |
ni.ifaddresses('eth0') | |
IP = ni.ifaddresses('eth0')[ni.AF_INET][0]['addr'] | |
return IP | |
def displayTime(): | |
'''Sorts the time out for the app''' | |
localtime = time.asctime( time.localtime(time.time()) ) #Gets the time | |
print (" * Current time :" + str(localtime)) #Displays Time | |