473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

on click of button open another script

i have a basic window using tkinter with a button
that opens hello message

but before the hello message i want it to run a basic python script the exit the script then show the message

Expand|Select|Wrap|Line Numbers
  1. import Tkinter
  2. import tkMessageBox
  3.  
  4. top = Tkinter.Tk()
  5.  
  6. def FstartCallBack():
  7.    tkMessageBox.showinfo( "Action Complete", "Activated")
  8.  
  9. B = Tkinter.Button(top, text ="Activate", command = FstartCallBack)
  10.  
  11. B.pack()
  12. top.mainloop()
the script is in the same dir and is called on.py
Jun 4 '15 #1
1 1960
bvdet
2,851 Expert Mod 2GB
You could do something like this:
Expand|Select|Wrap|Line Numbers
  1. import Tkinter
  2.  
  3. top = Tkinter.Tk()
  4.  
  5. def FstartCallBack():
  6.     top.grab_release()
  7.     top.withdraw()
  8.     # run your script here
  9.     B.pack_forget()
  10.     L = Tkinter.Label(top, text="Activated")
  11.     L.pack()
  12.     top.title("Action Complete")
  13.     top.minsize(width=250, height=20)
  14.     top.wm_deiconify()
  15.     top.grab_set()
  16.  
  17. B = Tkinter.Button(top, text ="Activate", command = FstartCallBack)
  18.  
  19. B.pack()
  20. top.mainloop()
Jun 4 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: [Yosi] | last post by:
I search solution for a little bit strange problem , I working on an application which includes a button. Click on this button will create number of threads each one execute deferent executable...
5
by: Steve | last post by:
Hi, Is it possible to make hitting the enter key in an ASP textbox run the code behind an ASP button on a form? I have a search page which users tend to type in the query then just hit enter...
2
by: Mariame | last post by:
Hi everyone I have a button that open a new web page so i use the following script response.write("<script>window.open(url,'Name')</script>") every time the user click on the button it opens a new...
0
by: radders | last post by:
Hi guys, What I'd like to do is place three edit boxes with three static text labels on a click button. This would let the user input RGB values to the three edit boxes and then click the...
3
by: eddie69 | last post by:
Hi, Newbie question here: I am creating an application in VB Studio 2005 which reads the status of an USB PIR Motion sensor. So far, I have managed to get the application to read the motion...
12
by: Thammarat charoenchai. | last post by:
Hi, I'm try to learn vb.net. in delphi have .click method for click button by coding. Can I do that with vb.net Thank you very much.
4
by: nittin14 | last post by:
hi guys i m a beginner in Asp.net can u tell me that how to open page in new window after click button as well as i want to pass some data from this page. thanks
5
by: laziers | last post by:
Hi, anyone know how to write a single-cilick button? I use this: <asp:button id="ButtonAdd" runat="server" text="Anuluj" onclick="Click_ButtonAdd" /> if ( !isPostBack){...
3
by: Zippy | last post by:
I have recently moved from A97 to A2003. I find it inconvenient that I can no longer double-click on the subform to open it in full view. I had a hunt around the newgroups and couldn't find...
0
by: abdulazees | last post by:
when click button i want to print autometicaly reportveiwer data, i not need to show reportviewer.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.