call von Test Funktionen dazu in die Menüs. Aufruf einer externen Python Funktion . Rückgabe von Ergebnissen über eine Datei.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
;; ============================================================
|
||||
;; tests.lsp - Test- und Hilfsfunktionen
|
||||
;; ============================================================
|
||||
|
||||
(defun c:CALLPYTHON ( / log-pfad py-skript return-datei cmd fh zeile)
|
||||
(setq log-pfad (getenv "DXFM_LOG"))
|
||||
(setq py-skript (strcat (getenv "DXFM_LIB") "\\testpycall.py"))
|
||||
(setq return-datei (strcat log-pfad "\\testpycall_return.txt"))
|
||||
(if (findfile py-skript)
|
||||
(progn
|
||||
(setq cmd (strcat "python \"" py-skript "\" \"" log-pfad "\""))
|
||||
(command "_.SHELL" cmd)
|
||||
(if (findfile return-datei)
|
||||
(progn
|
||||
(setq fh (open return-datei "r"))
|
||||
(setq zeile (read-line fh))
|
||||
(close fh)
|
||||
(princ (strcat "\n[SSG_LIB] Python Rueckgabe: " zeile))
|
||||
)
|
||||
(princ "\n[SSG_LIB] WARNUNG: Keine Rueckgabe von Python erhalten.")
|
||||
)
|
||||
)
|
||||
(princ (strcat "\n[SSG_LIB] FEHLER: " py-skript " nicht gefunden!"))
|
||||
)
|
||||
(princ)
|
||||
)
|
||||
|
||||
(defun c:EXPORTCSV ()
|
||||
(princ "\n[SSG_LIB] EXPORTCSV: Noch nicht implementiert (Dummy).")
|
||||
(princ)
|
||||
)
|
||||
Reference in New Issue
Block a user