8

コマンドラインから IPython を実行したい。ただし、最初の行で構文エラーが発生します。魔法の関数を使用して pylab をインポートすると%pylab、% で構文エラーが発生します。私が使用しているコマンドは単純ipython -i script.pyです。

これを解決する方法はありますか?

4

1 に答える 1

6

ファイルに 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.)
于 2014-02-04T03:49:53.570 に答える