473,320 Members | 1,939 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,320 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 1957
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.