LoginSignup
0
0

More than 5 years have passed since last update.

iPythonでoptparseを使う場合

Posted at

問題

optparseを用いたスクリプトをipythonで実行する時、通常の
$ python main.py -i ./hoge.txt
という書き方にならって
$ ipython main.py -i ./hoge.txt
と実行してもオプションが認識されない。

解決策

$ ipython -- main.py -i ./hoge.txt
とする。
これにより、--以降のコマンドはipythonによりパースされず、正常に実行できる。

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