Exemplo n.º 1
0
# Copyright (C) 2018  BitLogiK

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

import HomeTicker
import time

myticker = HomeTicker.HomeTicker()
print "PRESS CTRL+C TO QUIT"


def printdate(oneticker):
    present_time = time.localtime()
    oneticker.pos_cursor(1, 1)
    remaining = 60 - present_time.tm_sec
    date = time.strftime("%a %d %b %Y", present_time).center(20)
    oneticker.write(date)
    hour = time.strftime("%H:%M", present_time)
    oneticker.pos_cursor(2, 8)
    oneticker.write(hour)
    time.sleep(remaining)

Exemplo n.º 2
0
#!/usr/bin/python2.7
# -*- coding: utf8 -*-

# Example for HomeTicker
# Basic example that displays 'hello world'
# Copyright (C) 2018  BitLogiK

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

import HomeTicker

myticker = HomeTicker.HomeTicker(False)
myticker.write(u"hello, world!")
myticker.close()
Exemplo n.º 3
0
        hometicker.clear_screen()
        hometicker.write(self.name[1:20])
        hometicker.pos_cursor(2, 1)
        hometicker.write("%.2f %s" % (self.latest, self.currency))
        hometicker.pos_cursor(2, 16)
        hometicker.write("%+.0f" % (self.variation))

    def getname(self, code):
        f = urllib.urlopen("https://finance.yahoo.com/quote/" + code)
        datapage = f.read(500)
        startstr = datapage.find("content=\"") + 9
        self.name = datapage[startstr:].split(",")[1].replace(
            "amp;", "").replace("USD", "rate")


myhometicker = HomeTicker.HomeTicker()
myhometicker.write("Loading Wait")

apilist = []
while len(apilist) == 0:
    try:
        for stock in stock_code_list:
            apilist.append(YahooStockPrice(stock))
    except:
        print "Issue detected, check Internet"
        print "Retrying in 5 seconds..."
        print "Press CTRL+C to abort"
        time.sleep(5)
while True:
    try:
        for api in apilist:
Exemplo n.º 4
0
# Example for HomeTicker display
# Displays messages with unicode characters at different locations
# and changes the brightness
# Copyright (C) 2018  BitLogiK

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>

import HomeTicker
import time
myTicker = HomeTicker.HomeTicker()

myTicker.write(u"Cet été sera\n\rtrès chaud!CALIENTE!")
myTicker.pos_cursor(1,14)
myTicker.printchr(0xC8)
myTicker.pos_cursor(1,18)
myTicker.write(u"¤")
for b in range(1,5):
    print b,
    myTicker.set_brightness(b)
    time.sleep(2)
raw_input("PRESS ENTER TO EXIT")
myTicker.close()