首页 > 解决方案 > 在 ipython 中设置别名

问题描述

目前我正在maestro中调试自己的脚本。问题是我总是必须在 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 执行所有运行命令。

提前致谢。

标签: python-3.xipython

解决方案


所以,我并没有真正解决我的问题,但我在本教程的帮助下解决了这个问题,并试图理解 python 中导入的概念。我不得不重组一些模块,但现在%runipython shell 中的一个命令就可以解决问题。

希望它可以帮助任何人。


推荐阅读