shell脚本调用python模块

python helloworld.py代码为

# coding:utf-8
from __future__ import print_function
import sys
print(sys.path)

shell脚本run.sh为

#! /bin/bash
# 注意上面一行不是注释
PATH=/home/anaconda3/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
python -m helloworld
exit 0

执行sh run.sh就能运行.

posted on 2017-09-04 18:05  荷楠仁  阅读(777)  评论(0编辑  收藏  举报

导航