学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年4月24日

摘要: 在使用git提交python源码的时候出现whitespace error: trailing space at end of line的错误,仔细分析一下源文件,发现源码中的确存在行尾是空格的情况。按照常规,这样的情况是不应该出现的,而且也是无意义的,所有行尾的空格都应该去掉才对。仔细分析了一下,有可能是常用的几个python编辑器中某一个在处理trailing space的时候设置不对或者处理不当的问题:简单测试了一下:Sublime Text2 默认情况下就处理 trailing spacePython IDLE 默认情况下也处理 trailing spacepyDev/Aptana默认 阅读全文
posted @ 2012-04-24 14:45 Jerry.Kwan 阅读(1039) 评论(0) 推荐(0) 编辑

摘要: 因为经常在windos平台和linux平台之间协同开发,所以不可避免的就碰到了CRLF的问题,dos2unix 和 unix2dos可以说是最常用的解决CRLF问题的工具了。下面列出怎么对整个目录中的问题做dos2unix操作$ find . -type f -exec dos2unix {} \;其中具体命令的解释如下:find .= find files in the current directory-type f= of type f-exec dos2unix {} \;= and execute dos2unix on each file found 阅读全文
posted @ 2012-04-24 10:23 Jerry.Kwan 阅读(9716) 评论(2) 推荐(1) 编辑