spb
spb

Reputation: 175

run script from spyder console using relative path

I want to run .py file from ipython console in spyder. Script also takes csv file as input. But I got Exception: File src.py not found. How do I run the script from spyder console using relative path?

run src.py input.csv

Upvotes: 0

Views: 613

Answers (1)

Benjamin Rio
Benjamin Rio

Reputation: 656

In this format, the path to your file is relative to the command working directory. Therefore, with your command, it looks for src.py in the directory where the console is running (that you can check by running pwd).

Therefore, you should either :

  • input absolute paths
  • open the command to the directory where your files (the script and the csv) are

Upvotes: 1

Related Questions