python xxxx.py运行即可。
如果你说的是编译安装python,无非就是make;make install。源码包里面也会有说明的。一般linux里面有已经安装了python。
1.选择File ->Settings
2.选择 File and Code Templates ->Files ->Python Script
编辑代码的样式
#!/usr/bin/env python
# encoding: utf-8
'''
@author: caopeng
@license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited.
@contact: [email protected]
@software: garner
@file: ${NAME}.py
@time: ${DATE} ${TIME}
@desc:
'''
3.新建一个python,文件如下所示
假你想写一个文件filename='/root/wujin/5.2/03.html'但是文件夹可能不存在。
先这样子
targetpath = os.path.dirname(filename)
if not os.path.isdir(targetpath):
os.makedirs(targetpath)
然后你就可以打到filename,写入内容了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)