Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; == CallPyHelp.au3
- #Region - TimeStamp
- ; 2014-01-03 14:35:29
- #EndRegion - TimeStamp
- #include <File.au3>
- ;~ mk:@MSITStore:C:\Python27\Doc\python274.chm::/genindex.html#
- ;~ mk:@MSITStore:C:\Python27\Doc\python274.chm::/genindex-O.html
- Global $sPathPy = _GetPythonPath()
- Global $sFileHelp, $aFiles = _FileListToArray($sPathPy & '\doc', '*.chm', 1, True)
- ConsoleWrite(@error & @LF)
- For $i = 1 To $aFiles[0]
- If StringInStr(StringLower($aFiles[$i]), 'python') Then
- $sFileHelp = $aFiles[$i]
- ExitLoop
- EndIf
- Next
- Global $sHelpBase = " mk:@MSITStore:" & $sFileHelp & "::/genindex"
- Global $sCall = ".html#"
- If $CmdLine[0] Then
- $FirstChar = StringUpper(StringLeft($CmdLine[1], 1))
- $sCall = "-" & $FirstChar & ".html"
- EndIf
- ShellExecute("hh.exe", $sHelpBase & $sCall)
- Func _GetPythonPath()
- Local $PyExe = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe", "")
- If @error Then Return ""
- Return StringLeft($PyExe, StringInStr($PyExe, '\', 1, -1) -1)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement