到目前为止,我一直在尝试用python创建一个双因素身份验证脚本。它现在运行得非常好,我想创建一个gui,因为它将在raspberry pi上几乎全天候运行。你知道吗
我不明白医生说的“拉伸”是什么意思。传递一个描述行/列是否应该拉伸的字符串,以填充整个GUI。“你知道吗
#!/usr/bin/env python
import pyotp
import os
import sys
import math
import time
from appJar import gui
udstart = 1
app = gui("2FA Keys","480x320")
def count(n):
while n >= 0:
time.sleep(1)
n -= 1
if n == 0:
return 1
#Keygenertor function pass the base32 code
def keyGen(secret):
secretcalc = pyotp.TOTP(secret)
code = secretcalc.now()
Lcode = list(code)
Lcode.insert(3, " ")
Ocode = ''.join(Lcode)
return Ocode
#INIT CODES GO HERE
CoinbaseCode = keyGen("3JCAJVDGIW4KHUHL")
SiaCoinCode = keyGen("PFFO3KKKRQL6ACU5")
app.stretch(columns)
app.setFont(50)
app.addLabel("l2", "Sia Coin: " + SiaCoinCode, 0,0,0,0)
app.setLabelbg("l2", "blue")
app.addLabel("l1", "Coinbase: " + CoinbaseCode, 1,0,0,0) #Coinbase 2FA
app.setLabelBg("l1", "red")
while True:
if udstart == 1:
break
else:
time.sleep(30)
break
def update():
#UPDATE CODES GO HERE
CoinbaseCode = keyGen("3JCAJVDGIW4KHUHL") #Coinbase
SiaCoinCode = keyGen("PFFO3KKKRQL6ACU5")
app.setLabel("l2", "Sia Coin: " + SiaCoinCode)
app.setLabelBg("l2", "blue")
app.setLabel("l1", "Coinbase: " + CoinbaseCode)
app.setLabelBg("l1", "red")
#profit???
udstart = 0
app.registerEvent(update)
app.go()
我不知道该通过什么。你知道吗
如果查看appJar source code on GitHub,您可以确定应该传递给
stretch
的内容:看看
strech
是如何使用的:查看
setExpand
的源代码,我们可以看到strech的可能值:因此,可能的字符串是(不区分大小写)“None”、“Row”、“Column”或其他任何字符串(这将导致“ALL”)。你知道吗
这里也有记载:http://appjar.info/pythonWidgetLayout/#set-stretch-sticky
相关问题 更多 >
编程相关推荐