[英]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.