差異處
這裏顯示兩個版本的差異處。
下次修改 | 前次修改 | ||
python:mixed:run_script_at_same_python_path [2016/08/18 16:58] tony 建立 |
python:mixed:run_script_at_same_python_path [2023/06/25 09:48] (目前版本) |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | {{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? ===== | ||
+ | 程式內容主要為: | ||
+ | - 取得python相同目錄的script路徑。 | ||
+ | - 賦予此script執行權限。 | ||
+ | - 執行script。 | ||
<code python> | <code python> | ||
import os | import os | ||
行 15: | 行 23: | ||
os.system(collect_script) | os.system(collect_script) | ||
</code> | </code> | ||
+ | |||
+ | |||
+ | ===== ===== | ||
+ | ---- | ||
+ | \\ | ||
+ | ~~DISQUS~~ |