From af2514b707b86e36bb457806052dd67488cd45b3 Mon Sep 17 00:00:00 2001 From: Dmitry Donskih Date: Tue, 13 Aug 2024 21:22:20 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B2=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D1=8C=20=D1=81=20Python=203.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Эта строка выдавала ошибку f-string expression part cannot include a backslash небольшой фикс, проверено на 3.9.19 --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 5186d16..c5cae91 100644 --- a/main.py +++ b/main.py @@ -349,8 +349,7 @@ def process_file_format(filename, filetype, gateway, selected_service, mk_list_n if ips: with open(filename, 'w', encoding='utf-8-sig') as file: for ip in ips: - file.write(f'/ip/firewall/address-list add list={mk_list_name} comment={str(selected_service).replace("[", "").replace("]", "").replace("\'", "")} address={ip.strip()}/32\n') - + file.write(f'/ip/firewall/address-list add list={mk_list_name} comment={str(selected_service).replace("[", "").replace("]", "").replace("{chr(39)}", "")} address={ip.strip()}/32{chr(10)}') else: @@ -434,4 +433,4 @@ async def main(): input(f"Нажмите {green('Enter')} для выхода...") if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main())