변환하려고합니다. VBScript 코드를 파이썬 (Win32) 코드로 변환했지만 행운이 없습니다!VBScript를 파이썬 스 니펫 변환
Dim objMain, objSysInf, stMsg
Set objMain = CreateObject("nnetcom.oMain")
Call objMain.UnlockComponent("xxx-xxxxx-xxxxx-xx")
Set objSysInf = CreateObject("nnetcom.oSystemInfo")
Call objSysInf.GetSystemInfos
stMsg = objSysInf.cOsName & " " & objSysInf.cOsType & vbCrLf & _
objSysInf.cOsCpu & vbCrLf & objSysInf.cOsMem & vbCrLf & _
objSysInf.cOsGpu
MsgBox stMsg, vbInformation, "System Information"
Set objSysInf = Nothing
Set objMain = Nothing
내가 윈도우 7을 실행하고있어 32 비트 파이썬 2.7.3 및 설치된 Windows 확장에 대한 파이썬 와. 또한 나는 ...에서 "makepy.pyc"을 실행하여 COM 객체를 추가 "해방 \ 사이트 - 패키지 \ win32com 클라이언트 \ \"...과 행운, 항상 어떤 오류 메시지가 점점
다음은 파이썬 코드입니다 :
import pythoncom
import win32com.client
objMain = win32com.client.Dispach("nnetcom.oMain")
ret = objMain.UnlockComponent("xxx-xxxxx-xxxxx-xx")
objSysInf = win32com.client.Dispach("nnetcom.oSystemInfo")
objSysInf.GetSystemInfos()
stMsg = objSysInf.cOsName
print(stMsg)
이 대화를 도와 줄 수있는 사람이 있습니까?
전체 오류 출력을 표시하십시오. C : \> C : \ PROGRA ~ 1 \ 파이썬 \ python.exe를 C : \는 역 추적 (마지막으로 가장 최근에 전화를) example2.py : – Marcin
** 안녕하세요 마르신 ** 여기 오류 출력 파일 :에, 4 행, "C \ example2.py" objMain = win32com.client.Dispach ("nnetcom.oMain") AttributeError : '모듈'개체가 어떤 속성 'Dispach' 당신이 날 도와 줄 수가 없습니다 ? ** Ragards, Viktor ** –
beic