Я бы хотел запустить скрипт на python (file.py)
Для этого я скопировал путь к этому файлу в интерпретаторе Python, но получил ошибку SyntaxError: unexpected character after line continuation character
Я новичок, и это самый простой способ запустить скрипт Python, который я нашел до сих пор ... Если у вас есть более простой способ, я открыт для советов ...
Спасибо
Вот мой скрипт на Python:
import os
import csv
ACCEPTED_MSG="""
Hi {},
We are thrilled to let you know that you are accepted to our
programming workshop.
Your coach is {}.
Can't wait to see you there !
Thank you,
Workshop Organizers
"""
REJECTED_MSG="""
Hi {},
We are verry sorry to let you know that due to a big number
of applications we couldn't fit you at the workshop this time...
We hope to see you next time.
Thank you,
Workshop Organizers
"""
path_to_file = "C:/Users/Julien/Downloads/data.csv"
file_exists = os.path.exists(path_to_file)
if file_exists:
csv_file = open(path_to_file)
csv_reader = csv.reader(csv_file, delimiter=',')
next(csv_reader)
for row in csv_reader:
name, email, accepted, coach, language = row
print (name, email, accepted, coach, language)
if accepted =='Yes':
msg = ACCEPTED_MSG.format(name, coach)
else:
msg = REJECTED_MSG.format(name)
print ("Send e-mail to: {}".format(email))
print("E-mail content:")
print (msg)
csv_file.close()