我有一个 GUI.exe
(由 .py
文件),其中有输入框。
我想从这个文件中获取在输入框中输入的值。GUI.exe
并在Python文件中使用它(.py
).
这可能吗?谁能帮帮我?
你可以通过以下方式创建一个csv
import csv
with open('GUI_data.csv', 'w') as file:
writer = csv.writer(file)
writer.writerows(all_data) #all_data should be list of all data
对于另一个文件,你可以这样做,将数据以列表的形式加载出来。
with open('GUI_data.csv', newline='') as file:
file_data = csv.reader(file, delimiter=',')
transfered_data = next(file_data) # transfered_data now holds the info as a list