代碼編寫跟著寫完,報這個錯誤
Traceback (most recent call last):
? File "D:/pycode/data_preprocessing/extractTxt.py", line 66, in <module>
? ? files2txt(filepath1)
? File "D:/pycode/data_preprocessing/extractTxt.py", line 26, in files2txt
? ? new2txtpath = os.path.join(savepath, new_name)
? File "C:\Program Files\Python38\lib\ntpath.py", line 109, in join
? ? genericpath._check_arg_types('join', path, *paths)
? File "C:\Program Files\Python38\lib\genericpath.py", line 152, in _check_arg_types
? ? raise TypeError('%s() argument must be str or bytes, not %r' %
TypeError: join() argument must be str or bytes, not 'NoneType'
2021-02-12
我覺得你是切割文件名和后綴的時候,splitext寫成split導致的。
2020-10-28
寫成
,導致new_name返回的是NoneType