Python论坛  - 讨论区

标题:[python-chinese] Re : 请教了:用win32service 来StartService出错

2006年11月16日 星期四 16:11

王明 mingwang在iflytek.com
星期四 十一月 16 16:11:22 HKT 2006

On 11/16/06, nmweizi [nmweizi在163.com] wrote:

 

> ÔÚwin32serviceutil.pyÖÐÒѾ­¶¨ÒåºÃÁË¡£ÈçÏÂÖ±½Óµ÷ÓÃwin32serviceutil.StartService¾Í¿ÉÒÔÁË£¬ÎªÊ²Ã´»¹Òª×Ô¼ºÐ´£¿£¿£¿

 

ÎÒÊÇ»­ÉßÌí×ãÁË£¬µ«»¹ÊÇÓÐÎÊÌ⣬ÊDz»ÊDZàÂëÎÊÌâ°¡£¬Ö¸µãһϣº

 

import win32serviceutil

 

win32serviceutil.StartService( 'test_service')

 

±¨´í£º

Traceback (most recent call last):

  File "E:\pyxml_test\tst_service.py", line 5, in -toplevel-

    win32serviceutil.StartService('test_service')

  File "D:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line 399, in StartService

    hs = SmartOpenService(hscm, serviceName, win32service.SERVICE_ALL_ACCESS)

  File "D:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line 76, in SmartOpenService

    return win32service.OpenService(hscm, name, access)

error: (1060, 'OpenService', '\xd6\xb8\xb6\xa8\xb5\xc4\xb7\xfe\xce\xf1\xb2\xa2\xce\xb4\xd2\xd4\xd2\xd1\xb0\xb2\xd7\xb0\xb5\xc4\xb7\xfe\xce\xf1\xb4\xe6\xd4\xda\xa1\xa3')

-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20061116/0e384d88/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年11月16日 星期四 16:26

Leo Jay python.leojay在gmail.com
星期四 十一月 16 16:26:09 HKT 2006

On 11/16/06, ÍõÃ÷ <mingwang在iflytek.com> wrote:
>
>   ±¨´í£º
>
> Traceback (most recent call last):
>
>   File "E:\pyxml_test\tst_service.py", line 5, in -toplevel-
>
>     win32serviceutil.StartService('test_service')
>
>   File "D:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line
> 399, in StartService
>
>     hs = SmartOpenService(hscm, serviceName,
> win32service.SERVICE_ALL_ACCESS)
>
>   File "D:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line
> 76, in SmartOpenService
>
>     return win32service.OpenService(hscm, name, access)
>
> error: (1060, 'OpenService',
> '\xd6\xb8\xb6\xa8\xb5\xc4\xb7\xfe\xce\xf1\xb2\xa2\xce\xb4\xd2\xd4\xd2\xd1\xb0\xb2\xd7\xb0\xb5\xc4\xb7\xfe\xce\xf1\xb4\xe6\xd4\xda\xa1\xa3')
>
>
°Ñ±¨´íµÄÐÅÏ¢´ò³öÀ´¿´¿´²»¾ÍÖªµÀÁË£¿
>>> print
'\xd6\xb8\xb6\xa8\xb5\xc4\xb7\xfe\xce\xf1\xb2\xa2\xce\xb4\xd2\xd4\xd2\
xd1\xb0\xb2\xd7\xb0\xb5\xc4\xb7\xfe\xce\xf1\xb4\xe6\xd4\xda\xa1\xa3'
Ö¸¶¨µÄ·þÎñ²¢Î´ÒÔÒÑ°²×°µÄ·þÎñ´æÔÚ¡£
>>>



-- 
Best Regards,
Leo Jay
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20061116/8c56a0eb/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年11月16日 星期四 16:37

Bruce Wang number5在gmail.com
星期四 十一月 16 16:37:03 HKT 2006

On 11/16/06, ÍõÃ÷ <mingwang在iflytek.com> wrote:
>
>   On 11/16/06, *nmweizi [nmweizi在163.com]* wrote:
>
>
>
> > ÔÚwin32serviceutil.pyÖÐÒѾ­¶¨ÒåºÃÁË¡£ÈçÏÂÖ±½Óµ÷ÓÃwin32serviceutil.StartService¾Í¿ÉÒÔÁË£¬
> Ϊʲô»¹Òª×Ô¼ºÐ´£¿£¿£¿
>
>
>
> ÎÒÊÇ»­ÉßÌí×ãÁË£¬µ«»¹ÊÇÓÐÎÊÌ⣬ÊDz»ÊDZàÂëÎÊÌâ°¡£¬Ö¸µãһϣº
>
>
>
> error: (1060, 'OpenService',
> '\xd6\xb8\xb6\xa8\xb5\xc4\xb7\xfe\xce\xf1\xb2\xa2\xce\xb4\xd2\xd4\xd2\xd1\xb0\xb2\xd7\xb0\xb5\xc4\xb7\xfe\xce\xf1\xb4\xe6\xd4\xda\xa1\xa3')
>
>
>>> s = \xd6\xb8\xb6\xa8\xb5\xc4\xb7\xfe\xce\xf1\xb2\xa2\xce\xb4
\xd2\xd4\xd2\xd1\xb0\xb2\xd7\xb0\xb5\xc4\xb7\xfe\xce\xf1
\xb4\xe6\xd4\xda\xa1\xa3'
>>> print s.decode('gbk')
Ö¸¶¨µÄ·þÎñ²¢Î´ÒÔÒÑ°²×°µÄ·þÎñ´æÔÚ

·þÎñ²»´æÔÚ, ¿´¿´ÊDz»ÊÇÃû×Ö´íÁË, ÔÚWindowsµÄ²Ù×÷½çÃæ»òÕßÓÃnet start/stop ²âÊÔÈ·ÈϺóÔÙÀ´µ÷python´úÂë

²»ÒªÐļ±, ¿´Çå³þÏëÇå³þÔÙ¶¯ÊÖ


-- 
simple is good
http://brucewang.net
skype: number5
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20061116/327d2e1a/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号