Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste ÜberarbeitungBeide Seiten der Revision | ||
development:python:windows [2019-04-09 18:01] – angelegt Martin Prochnow | development:python:windows [2019-04-09 18:02] – Martin Prochnow | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Windows ====== | ====== Windows ====== | ||
- | ===== Schnipsel | + | ===== COM-Wrapper-Klassen erstellen |
- | Modalen Dialog anzeigen: | + | |
+ | Um in Python auf COM-Schnittstellen zugreifen zu können, wird das Modul // | ||
<sxh python> | <sxh python> | ||
- | import | + | import sys |
+ | from win32com.client import makepy | ||
- | ctypes.windll.user32.MessageBoxA(0, | + | sys.argv |
- | " | + | |
- | os.path.abspath(os.curdir), | + | |
- | os.path.abspath(os.path.dirname(sys.argv[0])), | + | |
- | sys.winver, | + | |
- | ), "%s - Message" | + | |
- | ) | + | |
- | </sxh> | + | |
+ | makepy.main() | ||
+ | </ | ||
===== Windows-Service ===== | ===== Windows-Service ===== | ||
Zeile 24: | Zeile 22: | ||
import inspect | import inspect | ||
path = inspect.currentframe().f_code.co_filename | path = inspect.currentframe().f_code.co_filename | ||
+ | </ | ||
+ | |||
+ | ===== Schnipsel ===== | ||
+ | Modalen Dialog anzeigen: | ||
+ | <sxh python> | ||
+ | import os, sys, ctypes | ||
+ | |||
+ | ctypes.windll.user32.MessageBoxA(0, | ||
+ | " | ||
+ | os.path.abspath(os.curdir), | ||
+ | os.path.abspath(os.path.dirname(sys.argv[0])), | ||
+ | sys.winver, | ||
+ | ), "%s - Message" | ||
+ | ) | ||
</ | </ | ||
{{tag> | {{tag> | ||