The first thing I did, was googling for the word ligands. Learned again...
Do you try to change the Pythonhome? If then, why?
Without knowledge about your scripts and the directory tree, it's like guessing.
A little trick you can do, is to use the main-script you start, as kind of anchor.
No more problems with relative paths.
Just don't try to solve your problem in Bash. It's quick and dirty, but with Python you have a cleaner language and even an abstraction for Paths. This works on Linux, Mac and Windows.
Do you try to change the Pythonhome? If then, why?
Without knowledge about your scripts and the directory tree, it's like guessing.
A little trick you can do, is to use the main-script you start, as kind of anchor.
import sys from pathlib import Path # absolute path to your main program # sys.argv[0] is the script file # in most cases, this is a relative path # absolute converts it for you program_path = Path(sys.argv[0]).absolute() program_dir = program_path.parent # if your data is in program_dir/mol_data/ data_dir = program_dir / 'mol_data' # globbing, get all mol-files for mol_file in data_dir.glob('*.mol'): print(mol_file) # code to do something with the fileThe resulting paths are all absolute, because the program_path which was used, is absolute.
No more problems with relative paths.
Just don't try to solve your problem in Bash. It's quick and dirty, but with Python you have a cleaner language and even an abstraction for Paths. This works on Linux, Mac and Windows.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!