これはWindows用です:
たとえば、デスクトップに「mygrapher」という名前のフォルダーがあります。内部には、メイン ファイル「grapherMain.py」に必要な Python ファイルを含む「calculation」および「graphing」というフォルダーがあります。また、「grapherMain.py」は「graphing」に格納されています。ファイルを移動せずにすべてを実行するには、バッチ スクリプトを作成します。このバッチファイルを「rungraph.bat」としましょう。
@ECHO OFF
setlocal
set PYTHONPATH=%cd%\grapher;%cd%\calculation
python %cd%\grapher\grapherMain.py
endlocal
このスクリプトは「mygrapher」にあります。何かを実行するには、コマンド プロンプトにアクセスして、次のようにします。
>cd Desktop\mygrapher (this navigates into the "mygrapher" folder)
>rungraph.bat (this executes the batch file)