在ipython中设置别名

时间:2019-07-16 13:29:34

标签: python-3.x ipython

目前,我正在调试大师的脚本。问题是我始终必须在ipython shell中使用%run手动加载所有脚本。

我尝试使用alias_magic对其进行设置,但由于似乎没人在ipython中设置多行别名,我迷失了方向。

In [13]: %alias_magic sitemap_gui --cell %run /home/eggerluk/python_code    /SiteMapAggregator/philipp_orginal/cfg.py \
...: %run  /home/eggerluk/python_code/SiteMapAggregator/ligand_tracker/ligandtracker.py \
...: %run /home/eggerluk/python_code/SiteMapAggregator/gui/sitemapaggregator_utils.py \
...: %run /home/eggerluk/python_code/SiteMapAggregator/philipp_orginal/binding_sites.py \
...: %run /home/eggerluk/python_code/SiteMapAggregator/philipp_orginal/Visualization.py \
...: %run /home/eggerluk/python_code/SiteMapAggregator/philipp_orginal/sitemap_aggregator.py 
...: 
...: %run /home/eggerluk/python_code/SiteMapAggregator/sitemapaggregator_gui.py
...: 

我想用%sm_gui执行所有运行命令。

谢谢。

1 个答案:

答案 0 :(得分:0)

因此,我并没有真正解决问题,而是借助tutorial并试图理解python中导入的概念来解决问题。我不得不重组一些模块,但是现在ipython shell中的单个%run命令可以解决问题。

希望它对任何人都有帮助。