好久没有用Python了,居然忘记了怎么在Python IDLE中调试Python代码.百度了一下,然后还是写下来吧,以免以后又忘记了. 1. Set break point in the source file. 2. Show Python shell 3. Enable Debug 4. Run Module
再MacOs运行的PyCharm中,执行python文件,如果不指定python文件字符编码会报错: SyntaxError: Non-ASCII character , but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details 所以 找到FIle > Default settings > Editor > File and Code Templates > Python Scrip
下面提供一个比较完整的示例程序,一共有四个文件:main.cpp.test.c.test.h.test.hpp main.cpp #include "test.hpp" int main() { fun(); //相当于在公共命名空间 ; } test.hpp #ifndef _TEST_HPP_ #define _TEST_HPP_ #ifndef __cplusplus #error Do not include the hpp header in a c project! #en