简体   繁体   中英

How to deal with Non-ASCII Warning when performing Save on Python code edited with IDLE?

I frequently edit Python code using IDLE and occasionally when I perform a Save I receive an I/O Warning.

在此处输入图片说明

I am assuming that I have inadvertently added a Non-ASCII character, and I do not really want to declare the cp1252 encoding.

Is there an easy way to find and delete the Non-ASCII that the Warning relates to?

The OS Version involved is Windows 7, and the Python version is 2.6.5

The regex [^ -~] will match anything except printing ASCII characters. It should be able to find your stray non-ASCII character.

Use it with IDLE's Search dialogue (Ctrl + F, or Edit → Find); it can search by regex:

搜索

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM