# Find absolute path of the libraries folder from within a library?

**URL:** https://discourse.processing.org/t/find-absolute-path-of-the-libraries-folder-from-within-a-library/37210
**Category:** Libraries
**Created:** [May 29, 2022, 6:11pm UTC](https://discourse.processing.org/t/find-absolute-path-of-the-libraries-folder-from-within-a-library/37210 "2022-05-29T18:11:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)
#### Post date: [May 29, 2022, 6:11pm UTC](https://discourse.processing.org/t/find-absolute-path-of-the-libraries-folder-from-within-a-library/37210/1 "2022-05-29T18:11:21Z")

</div>

I’m currenty writing a library for using Quantum annealers with processing.  
However run programs on these I need my library to run python scripts and for that I first need my library to be able to find them.  
Is there an easy way of finding the library folder?

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 29, 2022, 7:39pm UTC](https://discourse.processing.org/t/find-absolute-path-of-the-libraries-folder-from-within-a-library/37210/2 "2022-05-29T19:39:01Z")

</div>

Hi

Some hints in this link

> **[Getting the sketchbook / libraries path from within a sketch - Processing Forum](https://forum.processing.org/one/topic/getting-the-sketchbook-libraries-path-from-within-a-sketch.html)**
>
> Processing Forum

---

<div class="post-metadata">

### Author: ![robertesler](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@robertesler](https://discourse.processing.org/u/robertesler)
#### Post date: [May 30, 2022, 3:46pm UTC](https://discourse.processing.org/t/find-absolute-path-of-the-libraries-folder-from-within-a-library/37210/3 "2022-05-30T15:46:45Z")

</div>

Hi @NumericPrime  
If you can include the Python scripts with your sketch you can try using:

```auto
setup() {
 String path = this.dataPath("");
   //format this for your OS, / for Unix, \\ for Win
   path = path + "\\PyScript.py";
}

```

You will need to put the scripts in a folder called ‘data’ in your root sketch folder. I find this to be the easiest method of finding resources necessary for the sketch. Java’s getPath() and getAbsolutePath() usually will return the path of the Processing.exe application.

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [May 31, 2022, 6:35am UTC](https://discourse.processing.org/t/find-absolute-path-of-the-libraries-folder-from-within-a-library/37210/4 "2022-05-31T06:35:10Z")

</div>

> [@robertesler](#):
>
> `String path = this.dataPath("");`

[**dataPath()**](http://processing.github.io/processing-javadocs/core/processing/core/PApplet.html#dataPath-java.lang.String-)

`final String path = dataPath("PyScript.py");`
