在 Spyder 中定义无标题文档的结构
Define the structure of an untitled document in Spyder
当 Python 2.# 风靡一时时,我曾经知道如何使用 Spyder 做到这一点。几年过去了,我又开始编程了,所以记忆力不如从前了。
使用 "Spyder 3.1.3" 我希望能够告诉它当我单击 "New Document"(工具栏按钮或使用文件菜单)打开一个已包含 "import" 代码的无标题文档时键入。我最常使用这些包。
例如:
当前"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
.
当 Python 2.# 风靡一时时,我曾经知道如何使用 Spyder 做到这一点。几年过去了,我又开始编程了,所以记忆力不如从前了。
使用 "Spyder 3.1.3" 我希望能够告诉它当我单击 "New Document"(工具栏按钮或使用文件菜单)打开一个已包含 "import" 代码的无标题文档时键入。我最常使用这些包。
例如: 当前"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
.