Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save devlights/8864c4c7c01e4e97e6db27d38c8b7f61 to your computer and use it in GitHub Desktop.

Select an option

Save devlights/8864c4c7c01e4e97e6db27d38c8b7f61 to your computer and use it in GitHub Desktop.
[Python] IPythonの起動時に指定したモジュールを読み込んでもらう

概要

$ ipython profile create
  • $HOME/.ipython/profile_default の下にファイルが作成される
  • ipython_config.py を編集

起動時に指定したモジュールを読み込み

  • c.InteractiveShellApp.exec_lines に必要なモジュール読み込みを文字列で記述する。
## lines of code to run at IPython startup.
c.InteractiveShellApp.exec_lines = [
    'import sys',
    'import os',
    'import re',
    'import shutil',
    'import pathlib',
    'import csv',
    'import json',
    'import lxml',
    'import xml.etree as etree',
    'import itertools',
    'import functools',
    'import collections',
    'import pyperclip'
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment