Jupyter-ipython-command-line-options
IPython-コマンドラインオプション
この章では、IPythonでさまざまなコマンドラインオプションを操作する方法を理解しましょう。
IPythonプログラムの呼び出し
次のオプションを使用してIPythonプログラムを呼び出すことができます-
C:\python36> ipython [subcommand] [options] [-c cmd | -m mod | file] [--] [arg]
ファイルオプションは、拡張子が.pyのPythonスクリプトです。 他のオプションが指定されていない場合、スクリプトが実行され、コマンドプロンプトが再表示されます。
C:\python36>ipython hello.py
Hello IPython
welcome to interactive computing
サブコマンドとパラメーター
IPythonコマンドは、次のサブコマンドオプションを受け入れます-
- プロファイル-IPythonプロファイルを作成および管理します。
- Kernel -フロントエンドが接続されていないカーネルを起動します。
- Locate -IPython dirへのパスを出力します。
- 履歴-IPython履歴データベースを管理します。
IPythonプロファイルサブコマンドは、次のパラメータを受け入れます-
- ipython profile create myprofile -新しいプロファイルを作成します。
- ipython profile list -利用可能なすべてのプロファイルを一覧表示します。
- ipython Locate profile myprofile -必要なプロファイルを見つけます。
新しいIPythonカーネルをインストールするには、次のコマンドを使用します-
Ipython kernel –install –name
IPythonディレクトリへのパスを印刷するには、次のコマンドを使用します-
C:\python36>ipython locate myprofile
C:\Users\acer\.ipython
その上、我々はそれを知っています-
- history サブコマンドは、IPython履歴データベースを管理します。
- trim オプションは、IPython履歴データベースを最後の1000エントリに減らします。
- clear オプションは、すべてのエントリを削除します。
IPythonの他の重要なコマンドラインオプションのいくつかを以下に示します-
Sr.No. | IPython Command & Description |
---|---|
1 |
--automagic マジックコマンドの自動呼び出しをオンにします。 |
2 |
--pdb すべての例外の後、pdbデバッガーの自動呼び出しを有効にします。 |
3 |
--pylab デフォルトのmatplotlibバックエンドでインタラクティブに使用するために、matplotlibとnumpyをプリロードします。 |
4 |
--matplotlib デフォルトのmatplotlibバックエンドで対話的に使用するためにmatplotlibを設定します。 |
5 |
--gui=options (「glut」、「gtk」、「gtk2」、「gtk3」、「osx」、「pyglet」、「qt」、「qt4」、「qt5」、「tk」、「 wx '、' gtk2 '、' qt4 ')。 |
IPythonコマンドラインオプションのいくつかの使用例は、次の表に示されています-
Sr.No. | IPython Command & Description |
---|---|
1 |
ipython --matplotlib matplotlib統合を有効にする |
2 |
ipython --matplotlib=qt matplotlibとqt4バックエンドの統合を有効にします |
3 |
ipython --profile=myprofile プロファイルfooで開始 |
4 |
ipython profile create myprofile デフォルトの設定ファイルでプロファイルfooを作成 |
5 |
ipython help profile profile subcmdのヘルプを表示します |
6 |
ipython locate IPythonディレクトリへのパスを出力します |
7 |
ipython locate profile myprofile プロファイル「myprofile」のディレクトリへのパスを出力します |