[英]I cant find the problem in my code for translating phone numbers from alphanumeric characters to all numbers
[英]my code is throwing a indent error and i cant find the problem
我正在使用 pyqt5 模塊,它拋出一個縮進錯誤這里是拋出錯誤的代碼位
我試圖將塊放在文本瀏覽器變量之后
from PyQt5 import QtCore, QtGui, QtWidgets
with open("data.txt", "a+") as data_file:
try:
for text in data_file:
textBrowser.append(text)
else:
for texts in data_file:
textBrowser.append(texts)`
我不確定你的縮進,但 try-else IMO 的正確形式是 try-except-else。 像這樣:
try:
...
except Exception:
...
else:
...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.