我在 python [os.system] 中标记 (") 时遇到问题

I'm having trouble marking (") in python [os.system]

这是脚本

from tkinter import *
import os

window = Tk()
window.title("Download from Web")
window.geometry("300x120+200+100")

photo = PhotoImage(file = "icon/icon.png")
window.iconphoto(False, photo)


urltxt = Label(window, text = "Url").place(x = 10, y = 10)  
url = Entry(window, width=30)
url.insert(0,"")
url.grid(row=1, column=0, padx=80, pady=10)


filetxt = Label(window, text = "Save File name").place(x = 10, y = 10)  
filename = Entry(window, width=30)
filename.insert(0,".exe,.zip,.rar")
filename.grid(row=2, column=0, padx=80, pady=10)



def Message():
    os.system(f"powershell -c "Invoke-WebRequest -Uri '{url.get()}' -OutFile '{filename.get()}'"")

btnSendMessage = Button(window, text="Search", width=20, command=Message)
btnSendMessage.grid(row=4, column=0, padx=10, pady=10)

window.mainloop()

我对这部分文字有疑问

def Message():
    os.system(f"powershell -c "Invoke-WebRequest -Uri '{url.get()}' -OutFile '{filename.get()}'"")

这两部分我遇到了问题,特别是当我将 ' 添加到代码时出现错误

'{url.get()}' and '{filename.get()}'

引号可以用反斜杠转义,如下所示:

os.system(f"powershell -c \"Invoke-WebRequest -Uri \'{url.get()}\' -OutFile \'{filename.get()}\'\"")