0

I'm trying to have a Python file that can operate through both terminal and IDEs in order to run tests. My goal is to have it find and manipulate files within other parts of my directory by entering a file name, however it won't reach outside its operating directory.

I've used os.py but it has the same results

dir_path = str(Path("261Calcs.py").parent.absolute())
print(dir_path)

Currently it just has the pathway show my user whenever acting in the terminal, and therefore can't access other files within other directories

kenlukas
  • 3,616
  • 9
  • 25
  • 36
  • I'm not sure what you're looking for. In the example you have given, do you want the absolute path of the directory containing the file `261Calcs.py`? – Anoop R Desai Aug 29 '19 at 17:47
  • [This might be useful for your problem](https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory) – ryan yang Aug 29 '19 at 18:04

0 Answers0