【发布时间】:2014-01-30 19:54:45
【问题描述】:
使用 %paste,iPython 将我的函数定义中的换行符作为函数的结尾。当我从别人的机器上编码时,这不是问题。我浏览了配置文档和其他网站;不走运。
def get_sheet(filepath, sheet_name):
book = open_workbook(filepath)
for name in book.sheet_names():
if sheet_name in name.lower():
sheet_name = name
sheet = book.sheet_by_name(sheet_name)
return sheet
SyntaxError: 'return' outside function
非常感谢 =)
【问题讨论】:
-
你有什么版本的 IPython?这对我有用。
标签: python ipython ipython-magic python-config