コマンドラインから IPython を実行したい。ただし、最初の行で構文エラーが発生します。魔法の関数を使用して pylab をインポートすると%pylab
、% で構文エラーが発生します。私が使用しているコマンドは単純ipython -i script.py
です。
これを解決する方法はありますか?
コマンドラインから IPython を実行したい。ただし、最初の行で構文エラーが発生します。魔法の関数を使用して pylab をインポートすると%pylab
、% で構文エラーが発生します。私が使用しているコマンドは単純ipython -i script.py
です。
これを解決する方法はありますか?
ファイルに script.ipy という名前を付ける必要があります。.ipy で終わる場合、ipython 構文を含めることができます。
からipython --help
:
Usage
ipython [subcommand] [options] [files]
If invoked with no options, it executes all the files listed in sequence
and exits, use -i to enter interactive mode after running the files. Files
ending in .py will be treated as normal Python, but files ending in .ipy
can contain special IPython syntax (magic commands, shell expansions, etc.)