30 lines
1016 B
Common Lisp
30 lines
1016 B
Common Lisp
;; ============================================================
|
|
;; tests.lsp - Test- und Hilfsfunktionen
|
|
;;
|
|
;; Export-Funktionen wurden nach export.lsp ausgelagert.
|
|
;; ============================================================
|
|
|
|
(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)
|
|
)
|
|
|