execute-script
執(zhí)行這個(gè)命令需要下面的內(nèi)容
@first #! /usr/bin/env python
@first # -*- coding: utf-8 -*-
@language python
@tabwidth -4
@others
ipython-exec
不能加 utf-8,否則會(huì)報(bào)錯(cuò)
Traceback (most recent call last):
File "/home/swot/leo/leo/plugins/qt_events.py", line 128, in eventFilter
k.masterKeyHandler(event)
File "/home/swot/leo/leo/core/leoKeys.py", line 3253, in masterKeyHandler
done = k.doMode(event, state, stroke)
File "/home/swot/leo/leo/core/leoKeys.py", line 3365, in doMode
handler(event)
File "/home/swot/leo/leo/core/leoKeys.py", line 2815, in repeatComplexCommandHelper
c.commandsDictlast
File "/home/swot/leo/leo/plugins/qt_gui.py", line 1051, in ipython_exec_f
g.app.ipk.run_script(file_name=c.p.h,script=script)
File "/home/swot/leo/leo/core/leoIPython.py", line 203, in run_script
code = compile(script, file_name, 'exec')
File "get access token --- execute-script", line 0
SyntaxError: encoding declaration in Unicode stringreading settings in /home/swot/.leo/workbook.leo
解決方法:
同時(shí)存在的解決方法,即將執(zhí)行 execute-script 的 node 作為 ipython-exec的父 node,這樣就可以選擇不同的 node 去執(zhí)行不同的命令了。Great!!!