PyCharm current working directory

前端 未结 8 1434

Recently, I\'m unable to use relative paths in my code while using PyCharm. For instance, a simple open(\'test.txt\', \'r\') will not work - whereupon I am sure

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 08:43

    In PyCharm, click on "run/edit configurations..."

    Then find your script file in the "Python" dropdown menu. Check the "Working Directory" entry and change it if necessary.

提交回复
热议问题