Я не понимаю, почему мой путь делает ошибку: r "D: \ Users \ lsi \ 2_TRIALS \ 1_TRIAL1 \ myfile.txt"
, когда я использую другой путь, он работает: r "C: \ Users \ lsi.PRT-001 \ Desktop \ myfile.txt "
происходит из-за использования драйвера D?
def traduction():
# fichier_traduction = r"C:\Users\lsi.PRT-001\Desktop\myfile.txt"
fichier_traduction = r"D:\Users\lsi\2_TRIALS\1_TRIAL1\myfile.txt"
file = open(fichier_traduction, newline='', encoding='utf-8')
reader = csv.reader(file)
liste = []
tupl = ()
sous_tuple = ()
for row in reader:
if len(row) > 0:
l = len(row[0])
if row[0][:1] =='#':
sous_tuple = sous_tuple + (row[0][5:],)
if row[0][3:4] =='i':
tupl = tupl + (sous_tuple,row[0][7:l-1],)
sous_tuple = ()
elif row[0][3:4] =='s':
tupl = tupl + (row[0][8:l-1],)
else:
liste.append(tupl)
tupl = ()
return liste
File "D:\Users\jl3\DevSpace\intensetbm-etool\export\urls.py", line 2, in <module>
from . import views
File "D:\Users\jl3\DevSpace\intensetbm-etool\export\views.py", line 233
file = open(fichier_traduction, newline='', encoding='utf-8')
^
TabError: inconsistent use of tabs and spaces in indentation