When using optparse with iPython

problem

When executing a script using optparse with ipython, it is normal $ python main.py -i ./hoge.txt Following the writing style $ ipython main.py -i ./hoge.txt The option is not recognized even if I execute.

solution

$ ipython -- main.py -i ./hoge.txt And. As a result, commands after -- will not be parsed by ipython and can be executed normally.

Recommended Posts

When using optparse with iPython
Using Japanese with Rodeo's IPython @ Windows
When using MeCab with virtualenv python
Precautions when using six with Python 2.5
About WARNING when packaging with pyinstaller using pyocr
Secret key generation when using EncryptedCookieStorage with aiohttp_session
How to deal with SessionNotCreatedException when using Selenium
Precautions when using google-cloud library with GAE / py
What are you using when testing with Python?
Summary when using Fabric
I tried using Ipython
Start IPython with virtualenv
Precautions when using Chainer
Make slides with iPython
Precautions when using sqlite3 on macOS Sierra (10.12) with multiprocessing
Troublesome story when using Python3 with VScode on ubuntu
I got an error when using Tensorboard with Pytorch
When using Union type with pydantic, combine it with Literal
(Personal) points when using ctypes
Using X11 with ubuntu18.04 (C)
Environment variables when using Tkinter
I got a Value Error when using JUMAN ++ with PyKNP
Parallel computing with iPython notebook
Try using PythonTex with Texpad.
Using Graphviz with Jupyter Notebook
[S3] CRUD with S3 using Python [Python]
Messaging with AMQP using kombu
Eliminate errors that occur when using Django REST Swagger with Django 3.0
Using Quaternion with Python ~ numpy-quaternion ~
Try using matplotlib with PyCharm
How to not load images when using PhantomJS with Selenium
When moss with pip install
Games using IMU with SenseHat
Code snippets often used when using BigQuery with Google Colab
Useful when debugging with TouchDesigner
[Python] Using OpenCV with Python (Basic)
How to resolve CSRF Protection when using AngularJS with Django
Play with Jupyter Notebook (IPython Notebook)
DEBUG settings when using Django
Class when inferring with fairseq
Use "% tensorflow_version 2.x" when using TPU with Tensorflow 2.1.0 in Colaboratory
Using a printer with Debian 10
Error when playing with python
When using if and when using while
File structure when using serverless-python-requirements
Things to keep in mind when using Python with AtCoder
Use configparser when using API
Run Apache-Spark with IPython Notebook
Things to keep in mind when using cgi with python.
Graph drawing with IPython Notebook
Try using folium with anaconda
Using OpenCV with Python @Mac
When developing with ipython, scrapy can no longer be read
Send using Python with Gmail
Use Bokeh with IPython Notebook
Small speedup when using pytorch
PATH when using ANACONDA virtual environment with Pycharm (as of Mac 2020/10/03)
[Python] Error and solution memo when using venv with pyenv + anaconda
Unable to bind to interface error when using apollo federation with gqlgen
Scribble what I used when using ipython in formatting pos data
When you want to send an object with requests using flask