如何 让python代码 输入或者输出变量供下一个指令使用?
我使用 插入代码段(Python)指令,要如何将变量输出来?
我看了说明文档,在最上一行代码去,设置一个 变量 =xx ;
但是这样以后,就执行不了了
代码如下
import tkinter as tk
def get_screen_resolution():
root = tk.Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
root.destroy() # Close the tkinter window after getting the resolution
return screen_width, screen_height
# Get screen resolution
screen_width, screen_height = get_screen_resolution()
print("屏幕宽度:", screen_width)
print("屏幕高度:", screen_height)
# Define a variable for display
display = get_screen_resolution()
print(display)有没有大佬能在此代码基础上帮忙改一下?
