I tried several ways but never succeeded. I need to change the directory in digital ocean (
OSError: [Errno 2] No such file or directory: '/folder/PH/Programs'
Either you provide the full path to file, or do not put a slash at the beginning. That means the root directory.
If it is in your home directory, or otherwise specify the full path to file.
(In fact, the path you say in your question is wrong for the same reason).