アンパサンドは処理しようとしているファイルの区切り文字なので、アンパサンドのすべてのインスタンスをPythonテキストファイルのカンマで置き換えようとしていますが、ファイルには影響しません。アンパサンドはPythonテキストファイルのカンマに置き換えられていません
commafile = open('/ampersandfile.txt')
my_file_contents = commafile.read()
commafile.close()
commafile = open('/csvfile.csv', 'w')
commafile.write(my_file_contents.replace('&', '& ').replace(', ', ', '))
commafile.close()
あなたは 'my_file_contents.replace( '&'、 ' ')'の代わりに 'my_file_contents.replace(' &'、 '& ').replaceを('、'、 '持っている必要はありません、 ') 'を実行し、csvfile.csvの結果を確認しますか? –