Phinehasz Zhi

超越你看到的

[python笔记]写python脚本第一步

Where to write

OS

windows

windows可以在pycharm里写
如果是windows写好测试了的,放linux,

vim test.py
:set ff=unix

因为windows的分隔符和unix不同

linux

要在linux运行,脚本开头需要

#!/usr/bin/env python  
or use
#!/usr/bin/python

使用中文:
#coding=UTF-8

脚本写完想直接和sh一样运行可以
chmod +x test.py

posted @ 2018-12-22 13:06  phinehasz  阅读(259)  评论(0编辑  收藏  举报