4

Вопрос по bash, python – Common Lisp: Запустить подпроцесс с другим рабочим каталогом, чем процесс lisp

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededПусть над лямбдаError: User Rate Limit Exceeded

#+:SBCL
(defun cwd (dir)
  (sb-posix:chdir dir))

(defun getcwd ()
  #+SBCL (sb-unix:posix-getcwd)
  #+CCL (current-directory))

(defmacro! with-cwd (dir &body body)
  `(let ((,g!cwd (getcwd)))
     (unwind-protect (progn
                       (cwd ,dir)
                       ,@body)
     (cwd ,g!cwd))))

Error: User Rate Limit Exceeded

(with-cwd "./B"
  (run-program ...))
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit ExceededcwdError: User Rate Limit Exceededthread_safety(5)Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceededcybertiggyr.com/gene/pathnames-0/node11.html

    от
  • Error: User Rate Limit ExceededcwdError: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от Clayton Stanley
  • Error: User Rate Limit Exceeded

    от Clayton Stanley
  • 0

    Error: User Rate Limit Exceeded

      import subprocess
      subprocess.Popen('python myscript.py', cwd='B')
    

  • 6

    Error: User Rate Limit Exceeded

    cwd

    (defun cwd (&optional dir)
      "Change directory and set default pathname"
      (cond
       ((not (null dir))
        (when (and (typep dir 'logical-pathname)
               (translate-logical-pathname dir))
          (setq dir (translate-logical-pathname dir)))
        (when (stringp dir)
          (setq dir (parse-namestring dir)))
        #+allegro (excl:chdir dir)
        #+clisp (#+lisp=cl ext:cd #-lisp=cl lisp:cd dir)
        #+(or cmu scl) (setf (ext:default-directory) dir)
        #+cormanlisp (ccl:set-current-directory dir)
        #+(and mcl (not openmcl)) (ccl:set-mac-default-directory dir)
        #+openmcl (ccl:cwd dir)
        #+gcl (si:chdir dir)
        #+lispworks (hcl:change-directory dir)
        #+sbcl (sb-posix:chdir dir)
        (setq cl:*default-pathname-defaults* dir))
       (t
        (let ((dir
           #+allegro (excl:current-directory)
           #+clisp (#+lisp=cl ext:default-directory #-lisp=cl lisp:default-directory)
           #+(or cmu scl) (ext:default-directory)
           #+sbcl (sb-unix:posix-getcwd/)
           #+cormanlisp (ccl:get-current-directory)
           #+lispworks (hcl:get-working-directory)
           #+mcl (ccl:mac-default-directory)
           #-(or allegro clisp cmu scl cormanlisp mcl sbcl lispworks) (truename ".")))
          (when (stringp dir)
        (setq dir (parse-namestring dir)))
          dir))))
    

    (cwd #p"../b/")
    (external-program:start "python" '("file.py") :output *pythins-stdout-stream* :input *pythons-stdin-stream*)
    (cwd #p"../a/")
    

    cdpython file.py &external-programcwdexternal-program:runexternal-program:start.

  • 1

    Error: User Rate Limit Exceeded

    .

    getcwdchdirasdf.