#+BEGIN_SRC python :var fname="QR_I_Love_YOU.png" :dir "data/images" :results file
import qrcode
img = qrcode.make("I Love YOU")
img.save(fname)
return fname
#+END_SRC
#+RESULTS:
[[file:/home/stardiviner/Org/Wiki/Computer Technology/Programming/Programming Languages/Python/Data/Packages/data/images/QR_I_Love_YOU.png]]
```
* More specific suggestion:
Make use of org-mode variable `org-link-file-path-type`.
When user generate a result with link (like:
```org
#+RESULTS:
[[file:/home/stardiviner/Org/Wiki/Computer Technology/Programming/Programming Languages/Python/Data/Packages/data/images/QR_I_Love_YOU.png]]
```
Org-mode babel always use relative file path for link, instead of absolute file path like upper example.
For example, if current path is `/home/stardiviner/Org/Wiki/Computer Technology/Programming/Programming Languages/Python/Data/Packages/`, then the relative file path link should be:
```org
#+RESULTS:
[[file:data/images/QR_I_Love_YOU.png]]
```
* About what one preceduce over the other problem
The header argument `:dir "data/images"` is used to specify my generated image's destination directory.
My suggestion is want a the result link use `org-link-file-path-type`. So the header argument `:dir` is not about the result link. Just it will be used. Like upper example.