Friday 15 May 2015

calling a python script on button click using python and tkinter -



calling a python script on button click using python and tkinter -

i have python script has functionality of sending email user. executed script , working fine. in python script have button, when click on button want other python script sends email executed.i have written next code:

#!/usr/bin/python import sys import os import tkinter import tkmessagebox top=tkinter.tk() def hellocallback(): os.system('sendemail.py') b=tkinter.button(top,text="hello",command= hellocallback) b.pack() top.mainloop()

i next error when click on button:

sh: 1:sendemail.py:not found.

could allow me know reason error , how can resolved.thanks.

i able figure out way phone call python script on button click:

instead of using os.system('sendemail.py') need utilize os.system('python sendemail.py')

python-2.7 tkinter

No comments:

Post a Comment