command='Channel: 1: %s \nMaxRetries: 0 \nRetryTime: 60 \nWaitTime: 30 \nSet: text=%s \nContext: 2 \nExtension: 2 \nPriority: 1 \n'%(number,message)
path='/var/spool/asterisk/for_copy/'
if os.path.exists(path):
f=open(path+'dial.call','w')
f.write(str(command))
f.close()
'ascii' codec can't encode characters in position 105-111: ordinal not in range(128)
Как правильно записать такой текст в файл?
Спасибо.