Hi,
I would like to call the same aplication executable with and without Graphical User Interface.
Requirement:
With Tkinter User interface,user can give the inputs to run the application ( Interactive).
Instead user will have this inputs in the file and it will be read by the batch utility or exe for the application
For example:
When we run the 'Sample.Exe' at the Python command prompt.It should ask for whether you want to run as Interactive-Yes, Batch (No).
Case-1 :- With User Interface:
------------------------------------------------
If user type 'Yes ',then Grapical User Interface has to display
Case-2 :- Without User Interface:
------------------------------------------------
if the user types 'No' ,then it should ask for the text file to be given as input tp execute the application.
To sumup:
if 'Yes':
# call Graphical User Interface
elif 'No'
# call batch application with < Sample1.in>
Can anybody guide me how to proceed with this options.
Thanks
PSB
3 2030
Here is something that might work for you.
Also included is the tkFileDialog with the native look and feel. - from Tkinter import Tk, Label
-
from tkFileDialog import askopenfilename
-
from SimpleDialog import SimpleDialog
-
-
-
if __name__ == '__main__':
-
root=Tk()
-
l = Label(root, text="Starting Application")
-
l.pack()
-
UIChooser = SimpleDialog(root, "Default is Batch Mode", ["Batch Mode", "Full GUI"],
-
0, 0, "Choose the user interface")
-
choice = UIChooser.go()
-
if not choice:
-
fileName = askopenfilename()
-
print fileName
-
fileName = fileName or ""
-
root.destroy()
-
else:
-
l.config(text="Running Full GUI")
-
root.mainloop()
-
Here is something that might work for you.
Also included is the tkFileDialog with the native look and feel. - from Tkinter import Tk, Label
-
from tkFileDialog import askopenfilename
-
from SimpleDialog import SimpleDialog
-
-
-
if __name__ == '__main__':
-
root=Tk()
-
l = Label(root, text="Starting Application")
-
l.pack()
-
UIChooser = SimpleDialog(root, "Default is Batch Mode", ["Batch Mode", "Full GUI"],
-
0, 0, "Choose the user interface")
-
choice = UIChooser.go()
-
if not choice:
-
fileName = askopenfilename()
-
print fileName
-
fileName = fileName or ""
-
root.destroy()
-
else:
-
l.config(text="Running Full GUI")
-
root.mainloop()
-
Thanks.
But I have to invoke the Batch and Interactive application.Suppose if I am not having the Tkinter installed in my system,then Batch application has to work,if Tkinter is available then I can use either Batch( Without User Interface) or Interactive ( With User Interface)
-PSB
Here is something that might work for you.
Also included is the tkFileDialog with the native look and feel. - from Tkinter import Tk, Label
-
from tkFileDialog import askopenfilename
-
from SimpleDialog import SimpleDialog
-
-
-
if __name__ == '__main__':
-
root=Tk()
-
l = Label(root, text="Starting Application")
-
l.pack()
-
UIChooser = SimpleDialog(root, "Default is Batch Mode", ["Batch Mode", "Full GUI"],
-
0, 0, "Choose the user interface")
-
choice = UIChooser.go()
-
if not choice:
-
fileName = askopenfilename()
-
print fileName
-
fileName = fileName or ""
-
root.destroy()
-
else:
-
l.config(text="Running Full GUI")
-
root.mainloop()
-
Is this piece of code works in UNIX environment?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark 'Kamikaze' Hughes |
last post by:
In the new Python game I'm developing, I need to crop out individual
tiles from larger tilesets, and maintain transparency. Unfortunately,
I've...
|
by: srijit |
last post by:
Hello,
Any idea - why the following code crashes on my Win 98 machine with
Python 2.3? Everytime I run this code, I have to reboot my machine.
I...
|
by: SeeBelow |
last post by:
Do many people think that wxPython should replace Tkinter? Is this
likely to happen?
I ask because I have just started learning Tkinter, and I...
|
by: Justin Ezequiel |
last post by:
What font is Tkinter using for displaying utf-8 characters?
On my Windows XP, most of the characters with names (unicodedata.name)
are displayed...
|
by: codecraig |
last post by:
Hi,
I was reading through the Tkinter tutorial at
http://www.pythonware.com/library/tkinter/introduction/index.htm ...and
it mentions that by...
|
by: syed_saqib_ali |
last post by:
Below is a simple code snippet showing a Tkinter Window bearing a
canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine.
When you...
|
by: Dick Moores |
last post by:
In a couple of places recently I've seen Brent Welch's _Practical
Programming in Tcl & Tk_ (<http://tinyurl.com/ynlk8b>) recommended
for learning...
|
by: bg_ie |
last post by:
Hi,
I'm in the process of writing some code and noticed a strange problem
while doing so. I'm working with PythonWin 210 built for Python 2.5. I...
|
by: karthikbalaguru |
last post by:
Hi,
One of my python program needs tkinter to be installed to run
successfully.
I am using Redhat 9.0 and hence tried installing by copying the...
|
by: joshdw4 |
last post by:
I hate to do this, but I've thoroughly exhausted google search. Yes,
it's that pesky root window and I have tried withdraw to no avail. I'm...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| |