# Load python script that is not in the current working directory from the comand line

**URL:** https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956
**Category:** ParaView Support
**Tags:** python
**Created:** [April 2, 2020, 11:34pm UTC](https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956 "2020-04-02T23:34:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![leoncwu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@leoncwu](https://discourse.paraview.org/u/leoncwu)
#### Post date: [April 2, 2020, 11:34pm UTC](https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956/1 "2020-04-02T23:34:16Z")

</div>

Hi,

I am trying to control Paraview using the macro (Python script). I know that I can load a Python script from the command line by adding a flag:

paraview --script=input.py

What if this “input.py” is not in the current working directory? So, I tried to give the full path to the Python script:

paraview --script= C:/sample/scripts/input.py

But it does not work. Paraview complains that it cannot open the file. Any suggestions?

Thanks.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [April 3, 2020, 12:12pm UTC](https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956/2 "2020-04-03T12:12:37Z")

</div>

It looks like you have a space between your equal sign and the C. I think you need to remote that and it will work. With ParaView v5.8 I can load a script with an absolute path.

---

<div class="post-metadata">

### Author: ![leoncwu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@leoncwu](https://discourse.paraview.org/u/leoncwu)
#### Post date: [April 6, 2020, 6:50pm UTC](https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956/3 "2020-04-06T18:50:28Z")

</div>

Thank you so much for the help. The space was an accident due to copy and paste, but I have resolved this issue.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 7, 2020, 3:33am UTC](https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956/4 "2020-04-07T03:33:59Z")

</div>

how did you solve it ?

---

<div class="post-metadata">

### Author: ![leoncwu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@leoncwu](https://discourse.paraview.org/u/leoncwu)
#### Post date: [April 7, 2020, 3:05pm UTC](https://discourse.paraview.org/t/load-python-script-that-is-not-in-the-current-working-directory-from-the-comand-line/3956/5 "2020-04-07T15:05:41Z")

</div>

I did in a tricky way by moving the target python script to the current working directory and read it without the original path in the command line.
