Re: [O] Python source block and :dir header arg

2019-04-05 Thread John Kitchin
I updated to the latest org, and I am not sure if you are seeing a bug. You might need to fix the space between : and session in your example, and name the session something. Also, you need to make sure the directory exists. This example works as expected for me: #+begin_src python :results output

Re: [O] Python source block and :dir header arg

2019-04-04 Thread stardiviner
Joao Cortes writes: > Consider the following python source block, > > #+begin_src python :results output : session :dir ./run > import os; > cwd = os.getcwd() > print(cwd) > #+end_src > > The dir header arg should change the directory used to run the session, > in

Re: [O] Python source block and :dir header arg

2019-04-03 Thread Joao Cortes
Thanks for checking. Do you know what to do now, assuming It is a bug?

Re: [O] Python source block and :dir header arg

2019-04-02 Thread John Kitchin
That looks different than what I see in org 9.2.1, if it has changed then it might be a bug indeed. What I see is: (default-directory (or (and dir (file-name-as-directory (expand-file-name dir))) default-directory)) I think :mkdirp is only for tangling

Re: [O] Python source block and :dir header arg

2019-04-01 Thread Joao Cortes
Looking at org-babel-execute-src-block, It seems the only way to get the the intended behavihour is adding :mkdirp "yes" or some other value that gives a true value to the result of the =and= call in the following snippet. This is the relevant code at ob-core.el, starting at line 681. #+begin_src

Re: [O] Python source block and :dir header arg

2019-04-01 Thread John Kitchin
You might need to provide some additional information about your setup (org-version, etc.). This works for me in org 9.1.9. John --- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268

[O] Python source block and :dir header arg

2019-04-01 Thread Joao Cortes
Consider the following python source block, #+begin_src python :results output : session :dir ./run import os; cwd = os.getcwd() print(cwd) #+end_src The dir header arg should change the directory used to run the session, in this case to the directory "../base/r