如何在 Panic Coda 中捕获无效 ASCII 字符?
有时,我在编码时会遇到错误,因为以错误的方式输入了某些组合键(例如 ALT + SHIFT + 方括号)。所以我在 Python 中遇到语法错误,但我看不到非法字符在哪里,因为 Coda 没有向我显示它。有什么解决办法吗?
Sometimes I get errors while coding, because of typing some combination of keys (eg. ALT + SHIFT + SQUARE BRACKET) in a wrong way. So I get Syntax Error in Python, but I can't see where the illegal character is, 'cause Coda do not show it to me. Any solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Python 使用 7 位 ASCII 字符集作为程序文本。因此,您需要做的就是通过转到 text > 将您的程序转换为 ASCII。转换为 ASCII。任何坏字符都会被自动删除。如果你想具体知道哪些字符是坏字符,可以使用 diff 来比较已更改和未更改的版本。
Python uses the 7-bit ASCII character set for program text. So all you need to do is convert your program to ASCII by going to text > convert to ASCII. Any bad characters will automatically be removed. If you want to specifically know which characters were the bad ones, you can use diff to compare changed and unchanged versions.