Traceback (most recent call last):
File "C:\Users\한찬희\Desktop\졸업작품\indexer_test1.py", line 191, in
<module>
with open('./searchJson2.json/') as data_file:
OSError: [Errno 22] Invalid argument: './searchJson2.json/
答案 0 :(得分:0)
因为路径不正确。删除尾部斜杠。
应该是:
以open(&#39; ./ searchJson2.json&#39;)作为data_file:
答案 1 :(得分:0)
你可以试试这个:
dir_path = os.path.dirname(os.path.realpath(__file__))
with open('{0}/searchJson2.json'.format(dir_path),'r+') as data_file: