【发布时间】:2016-09-14 05:57:06
【问题描述】:
上下文:
我正在修改一个小型 python 脚本,以便我从 Xcode 调试器运行的 lldb 命令的输出将输出到文件并以 sublime 文本打开。
import lldb
import os
import subprocess
def print_to_file(debugger, command, result, dict):
#Change the output file to a path/name of your choice
f=open("/Users/venkat13/pcomponents.txt","w")
debugger.SetOutputFileHandle(f,True);
debugger.HandleCommand(command)
path = "/Users/venkat13/pcomponents.txt"
sublimePath = '/Applications/Sublime\ Text.app'
subprocess.Popen("%s %s" % (sublimePath, path))
def __lldb_init_module (debugger, dict):
debugger.HandleCommand('command script add -f po.print_to_file print_to_file ')
问题:
上面的脚本正在生成文件,但它没有以崇高的文本打开。我哪里错了?
【问题讨论】:
标签: python xcode sublimetext2 lldb