当 Python 2.# 风靡一时时,我曾经知道如何使用 Spyder 来做到这一点。几年过去了,我又开始编程了,所以内存力不如从前了。
使用“Spyder 3.1.3”我希望能够告诉它当我单击“新建文档”(工具栏按钮或使用"file"菜单)打开一个已输入“导入”代码的无标题文档时。我最常使用这些软件包。
例如: 当前的“Untitled.py”:
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 19 10:05:42 2017
@author: Someone
"""
我想要的是:
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 19 10:05:42 2017
@author: Someone
"""
import numpy as np
import prettyplotlib as ppl
import matplotlib.pyplot as plt
import matplotlib as mpl
import math
from math import pi as pi
import pint
from prettyplotlib import brewer2mpl
ureg = pint.UnitRegistry()
set2 = brewer2mpl.get_map('Set2', 'qualitative', 8).mpl_colors
#color=set2[]
这可以用 Spyder 3.# 完成吗??
在此先感谢大家!
请您参考如下方法:
按照主菜单中的这条路线:工具 → 首选项 → 编辑器 → 高级设置。按下按钮为新模块编辑模板。编辑并保存 template.py。
