差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
python:mixed:run_script_at_same_python_path [2016/08/18 16:59] tony |
python:mixed:run_script_at_same_python_path [2023/06/25 09:48] (目前版本) |
||
---|---|---|---|
行 1: | 行 1: | ||
{{tag>python}} | {{tag>python}} | ||
====== Run a script that is related to the python file path ====== | ====== Run a script that is related to the python file path ====== | ||
+ | ===== Problem ===== | ||
+ | 程式目標為呼叫相同目錄的shell script。 | ||
===== How to? ===== | ===== How to? ===== | ||
+ | 程式內容主要為: | ||
+ | - 取得python相同目錄的script路徑。 | ||
+ | - 賦予此script執行權限。 | ||
+ | - 執行script。 | ||
<code python> | <code python> | ||
import os | import os |