博客园 首页 私信博主 显示目录 隐藏目录 管理 动画

Linux环境 使用 Python 编写 py 脚本

 

安装 conda     安装 sh 插件

wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
ls
chmod 777 Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
conda
source ~/.bashrc
conda deactivate
conda env list
python
conda install sh
vim test.py
python test.py 
vim test.py
chmod 777 test.py 

 

#!/usr/bin/python
# vim: set fileencoding=utf-8
#例如,可添加# vim: set fileencoding=utf-8 :
import sys
args = sys.argv
if len(args) < 2:
    print('参数不足')
    sys.exit()
if args[1]=='start':
    print('====启动 hadoop ====')
    print('====启动 hdfs ====')

 

posted @ 2022-06-29 21:13  CHANG_09  阅读(235)  评论(0)    收藏  举报