New way to find config file

Old way is os.getcwd(), this depends on the location where the call happens, so it may cause problem when you not in the script file directory. This fix use os.path.realpath(sys.argv[0]) to ensure the correct directory.