[問題] Python 子程序內變數提取至主程序問題
各位大佬們請幫幫新手小白~我想了好久了 先謝謝大家了
請問python主程序運行到觸發副程式(open_file)後,要怎?把副程式變數值提輸出到主程
序
def open_file():
filename = tf.askopenfilename()
if filename != '':
app=xw.App(visible=False)
wb=xw.Book(filename)
sht=wb.sheets[0]
ros=sht.used_range.rows.count
cos=sht.used_range.columns.count
print(ros)
wb.close()
app.quit()
else:
tkinter.messagebox.showerror(title='error', message='no select')
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.173.71.64
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1553359232.A.F6F.html
→
03/24 09:04,
5年前
, 1F
03/24 09:04, 1F
→
03/24 09:04,
5年前
, 2F
03/24 09:04, 2F
→
03/24 09:04,
5年前
, 3F
03/24 09:04, 3F
→
03/24 09:06,
5年前
, 4F
03/24 09:06, 4F
→
03/25 08:18,
5年前
, 5F
03/25 08:18, 5F
→
03/25 08:18,
5年前
, 6F
03/25 08:18, 6F
※ 編輯: zero06795 (118.171.230.146), 03/26/2019 08:25:02
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):