-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