写一个创建新文本的脚本需要要执行权限

#! usr/bin/env python
#encoding=utf8

def savefile(filename,lines_list):
    f= open(filename,mode="w")
    f.writelines(lines_list)
    f.close()

if __name__=="__main__":
    savefile("test.csv",["hello\r\n","world\r\n"])
    print "done!ddd"

上面这个脚本如果没有赋于x权限,看着能执行输出done可是就是看不着生成csv文件,
开始还东找西找一下,看是不是文件输出的路径弄错了,
后来顿悟,原来是使用chmod +x filehelper.py就搞定了,打完收工,看贴要回贴啊,同志吗

原文地址:https://www.cnblogs.com/lexus/p/1704748.html