当打开一个.h或.cpp文件时, Solution Explorer就自动展开文件所在的目录: 如果不想展开: Tools -> Options -> Projects And Solution -> General ->Track Active Item in Solution Explorer (去掉前面的对勾) 来自:http://blog.csdn.net/guowenyan001/arti
这个功能相当好,自动在Solution Explorer中展开并定位到当前代码所在的文件,免得自己找位置要找很久. 设置方法: tool>>options>>projects and solutions>> 勾上track active item in solution explorer>>OK 保存即可 中文版: 工具-选项-项目和解决方案-常规-在解决方案资源管理器中跟踪活动项(C)
1.递归yield使用: 嵌套列表展开 def flatten(nested): if type(nested)==list: for sublist in nested: for i in flatten(sublist): yield i else: yield nested print(list(flatten([[[1],2],3,4,[5,[6,7]],8]))) #结果为[1,2,3,4,5,6,7,8] 树的后序遍历: def postorderTraversal(self, ro