-2
Idon不知道为什么会发生这种情况。一直试图修复了一段时间,现在在分配之前引用的Python局部变量'Current_Balance'
def Bettings():
while True:
if "Rolling in 35." in Label.text:
Updated_Balance = driver.find_element_by_xpath("""//*[@id="balance"]""")
if "Rolling in 23." in Label.text:
Current_Balance = driver.find_element_by_xpath("""//*[@id="balance"]""")
if "Rolling in 28." in Label.text:
if Current_Balance < Updated_Balance:
GrayBetButton.click()
if Current_Balance > Updated_Balance:
RedBetButton.click()
Bettings()
错误:
UnboundLocalError: local variable 'Current_Balance' referenced before assignm
可能重复[Local(?)变量在赋值之前引用](http://stackoverflow.com/questions/11904981/local-variable-referenced-before-assignment) – schwobaseggl