LoginSignup
0
0

More than 1 year has passed since last update.

コマンドラインでpython -〇 の -〇 とは

Posted at

コマンドラインでpythonを実行するときの-〇とは

-〇は、インターフェイスオプション(オプション)と呼ばれ、
コマンドラインでpythonを実行するときにつけるオプションである。
オプションは20種類ぐらいあるが、-m 以外あまり使うことはない。

よく使う-mは何か

pythonモジュール(パッケージ)を実行するためのオプション
どこにあるモジュール(パッケージ)を実行できるかは以下で確認できる

C:\Users\user_name>python
>>> import sys
>>> sys.path
['', 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip', 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Python\\Python39\\DLLs', 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Python\\Python39', 'C:\\Users\\user_name\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages']

↑はpythonの環境変数に設定したパス

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0