"program.py"というテキストファイルにプログラムを書きました。このファイルをデスクトップに保存しました。 \ Users \ユーザーx0266161 \デスクトップ:私はPythonコマンドライン
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\x0266161>cd C:\Users\x0266161\Desktop\
C:\Users\x0266161\Desktop>python program.py
hello world
Now is it possible for me to execute the program without changing to the directory where program is stored.
when I try I am getting below error
C:\Users\x0266161\Desktop>cd ..
C:\Users\x0266161>cd ..
C:\Users>cd ..
C:\>python program.py
python: can't open file 'program.py': [Errno 2] No such file or directory
C:\>
コマンドラインを介してこれを実行したい私は、このパスのCに環境変数を設定しています。