Несколько вопросов:
1. Начинаю разбираться с потоками, написал вот такой класс, но что-то недопанимаю
Если импорты начиная со второго расположить т.к. ниже показано
#coding:utf-8
import threading
import xlwt
import xlrd
import datetime
import time
from os.path import dirname
from win32com.client.dynamic import Dispatch
import os
import sys
class SubThread(threading.Thread):
def __init__(self,dir,nw,visu,last,solvo):
threading.Thread.__init__(self)
self.daemon=False
self.dir=dir
self.nw=nw
self.visu=visu
self.last=last
self.solvo=solvo
def run(self):
week=int(self.nw)
oo=dirname(sys.argv[0])
wb2.Close(SaveChanges=1)
del excel
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Python26\lib\threading.py", line 532, in __bootstrap_inner
self.run()
File "D:\soft\python\projects\report 0.5\tests4\func2.py", line 43, in run
excel = Dispatch('Excel.Application')
File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 112, in Dispatch
IDispatch, userName = _GetGoodDispatchAndUserName(IDispatch,userName,clsctx)
File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 104, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 84, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
com_error: (-2147221008, '\xcd\xe5 \xe1\xfb\xeb \xef\xf0\xee\xe8\xe7\xe2\xe5\xe4\xe5\xed \xe2\xfb\xe7\xee\xe2 CoInitialize.', None, None)
В чём косяк?
2. как расшифровать вот эту строку
‘\xcd\xe5 \xe1\xfb\xeb \xef\xf0\xee\xe8\xe7\xe2\xe5\xe4\xe5\xed \xe2\xfb\xe7\xee\xe2 CoInitialize.’
u=u'\xcd\xe5 \xe1\xfb\xeb \xef\xf0\xee\xe8\xe7\xe2\xe5\xe4\xe5\xed \xe2\xfb\xe7\xee\xe2 CoInitialize.'
print u
запутался чёта я:)
