i = 0
while(i <= 121):
val = "elif call.data == \"f{0}\": \n \
FILTER[user_id] = '{1}' \n \
msg = bot.send_message(call.message.chat.id, \"Выбран стиль {0}.\") \n \
bot.register_next_step_handler(msg, load) \n \
bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup = None) \n \
".format(i, list[i+1])
f1 = open("D:/text1.txt", 'w')
f1.write(val)
i += 1
f1 = open("D:/text1.txt", 'w')
s = 'elif call.data == "f{0}": \n \
FILTER[user_id] = \'{1}\' \n \
msg = bot.send_message(call.message.chat.id, "Выбран стиль {0}.") \n \
bot.register_next_step_handler(msg, load) \n \
bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup = None) \n \
'
with open('D:/text1.txt', 'a') as f:
for i, value in enumerate(list[1:]):
f.write(s.format(i, value))
i = 0
with open("D:/text1.txt", "w") as f1:
while i <= 121:
val = 'elif call.data == "f{0}": \n \
FILTER[user_id] = \'{1}\' \n \
msg = bot.send_message(call.message.chat.id, "Выбран стиль {0}.") \n \
bot.register_next_step_handler(msg, load) \n \
bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup = None) \n \
'.format(
i, list[i + 1]
)
f1.write(val)
i += 1