是否可以在HP-UX下从Vim内部启动python线程?
我已经使用Python支持编译了Python 2.7.10和Vim 7.4(HP-UX 11.31 ia64)。 除了线程外,其他一切似乎都运行良好。下面是一个简单的例子是否可以在HP-UX下从Vim内部启动python线程?,python,vim,hp-ux,Python,Vim,Hp Ux,我已经使用Python支持编译了Python 2.7.10和Vim 7.4(HP-UX 11.31 ia64)。 除了线程外,其他一切似乎都运行良好。下面是一个简单的例子 from threading import Thread from time import sleep def threaded_function(arg): for i in range(arg): print i sleep(1) def start_thread():
from threading import Thread
from time import sleep
def threaded_function(arg):
for i in range(arg):
print i
sleep(1)
def start_thread():
thread = Thread(target = threaded_function, args=(5, ))
thread.start()
if __name__ == '__main__':
start_thread()
Python解释器执行得非常好
% python thread.py
0
1
2
3
4
但是,当我试图对其进行源代码分析时,Vim会产生一个错误(用python封装,所以您是从Vim内部还是从Vim外部运行上述脚本(即as
python thread_test.py
)?您似乎登录了两个不同的帐户。合并它们。所以您是从Vim内部还是从Vim外部运行上述脚本(即作为python-thread\u-test.py
)?您似乎已登录到两个不同的帐户。请合并它们。
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "<string>", line 11, in start_thread
File "/home/users/zemtsoe/local/lib/python2.7/threading.py", line 745, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread