PyCharm current working directory

前端 未结 8 1425

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:41

    I too had the same issue few minutes ago...but,with the latest version of PyCharm it is resolved by simply using the relative path of that file.. For instance, a simple f = open('test', 'r') will work.

提交回复
热议问题