Tkinter - How to set a variable based off an entrybox user inputUser input and command line argumentsHow to sort a list of objects based on an attribute of the objects?How do I check if a variable exists?How do I pass a variable by reference?How to check if type of a variable is string?How to access environment variable values?How to set environment variables in PythonHow to read a text file into a string variable and strip newlines?Asking the user for input until they give a valid responseSet a variable based off an input
Why is it bad to use your whole foot in rock climbing
In Pandemic, why take the extra step of eradicating a disease after you've cured it?
Is all-caps blackletter no longer taboo?
What do you call the action of "describing events as they happen" like sports anchors do?
Parsing text written the millitext font
If the pressure inside and outside a balloon balance, then why does air leave when it pops?
Should I be able to use the Gloom Stalker ranger's Dread Ambusher class feature when attacking before initiative has been rolled to add a d8 damage?
In The Incredibles 2, why does Screenslaver's name use a pun on something that doesn't exist in the 1950s pastiche?
How to represent jealousy in a cute way?
Melave d'Malka on Motze Yom Tov
Attempt to de-reference a null object when calling class method from Test class
Why vspace-lineskip removes space after tikz picture although it stands before the picture?
How strong someone should be in order to fly without servo assisted hydraulics?
What is the theme of analysis?
A life of PhD: is it feasible?
What is the proper event in Extended Events to track stored procedure executions?
What class is best to play when a level behind the rest of the party?
What's the best way to quit a job mostly because of money?
Is it advisable to add a location heads-up when a scene changes in a novel?
If absolute velocity does not exist, how can we say a rocket accelerates in empty space?
How does AFV select the winning videos?
How (un)safe is it to ride barefoot?
As easy as Three, Two, One... How fast can you go from Five to Four?
What do I need to do, tax-wise, for a sudden windfall?
Tkinter - How to set a variable based off an entrybox user input
User input and command line argumentsHow to sort a list of objects based on an attribute of the objects?How do I check if a variable exists?How do I pass a variable by reference?How to check if type of a variable is string?How to access environment variable values?How to set environment variables in PythonHow to read a text file into a string variable and strip newlines?Asking the user for input until they give a valid responseSet a variable based off an input
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am looking to make a theme park ticketing program in tkinter, i have already made it in python 3 but i am trying to implement it into tkinter. However, I am unsure on how to set a variable based off a user input in tkinter. I want the program to ask the the user to input an integer for the amount of tickets they would like to buy, this would lead to a variable which can then calculate a cost depending on how many tickets they want. Mainly i would like an input to be taken when they press a button, this would result in a new frame showing. One last thing would be that I have heard maybe using a spinbox to do this would be more effective but i am not really, however, if any of you know how to implement a spin box into my program it would be really helpful.
class PageAdultTickets(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg="red")
self.controller = controller
label1 = tk.Label(self, text="------------- Welcome to Fantasialand Ticket Station ------------", fg="Blue", font=controller.title_font)
label1.pack(side="top", fill="x", pady=10)
label2 = tk.Label(self, text=f"The price of 1 adult ticket is £adultTicket:0.2f", fg="steelblue", bg="yellow", font=controller.title_font)
label2.pack(side="top", fill="x", pady=5)
button1 = tk.Button(self, text="Go to Main Menu",
command=lambda: controller.show_frame("MainMenu"))
button1.pack(side="right")
v = tk.IntVar()
amAdultTickets = tk.Entry(self, textvariable=v)
amAdultTickets.pack(side="bottom")
s = v.get()
Thanks to everyone who tries to help!
python python-3.x tkinter
add a comment |
I am looking to make a theme park ticketing program in tkinter, i have already made it in python 3 but i am trying to implement it into tkinter. However, I am unsure on how to set a variable based off a user input in tkinter. I want the program to ask the the user to input an integer for the amount of tickets they would like to buy, this would lead to a variable which can then calculate a cost depending on how many tickets they want. Mainly i would like an input to be taken when they press a button, this would result in a new frame showing. One last thing would be that I have heard maybe using a spinbox to do this would be more effective but i am not really, however, if any of you know how to implement a spin box into my program it would be really helpful.
class PageAdultTickets(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg="red")
self.controller = controller
label1 = tk.Label(self, text="------------- Welcome to Fantasialand Ticket Station ------------", fg="Blue", font=controller.title_font)
label1.pack(side="top", fill="x", pady=10)
label2 = tk.Label(self, text=f"The price of 1 adult ticket is £adultTicket:0.2f", fg="steelblue", bg="yellow", font=controller.title_font)
label2.pack(side="top", fill="x", pady=5)
button1 = tk.Button(self, text="Go to Main Menu",
command=lambda: controller.show_frame("MainMenu"))
button1.pack(side="right")
v = tk.IntVar()
amAdultTickets = tk.Entry(self, textvariable=v)
amAdultTickets.pack(side="bottom")
s = v.get()
Thanks to everyone who tries to help!
python python-3.x tkinter
Tkinter Spinbox, tkinter Entry. Hope they help.
– Artemis Fowl
Mar 24 at 23:47
I've already looked at these, i still have a problem of getting the input and making it a variable.
– DeathResister
Mar 25 at 8:08
You have asked same question before and got comments that it is wrong to get the value of the entry just after it is created. You need to, for example, create another button that triggers a function to get the value and perform required calculation.
– acw1668
Mar 25 at 12:03
Yes, but exactly like I said, What is the command to get the entry, telling me my problem which i am fully aware of is not helping at all, I asked it before because i got no genuine response and you posting your very unhelpful question is not going to make me want to post again. So kindly either help me or ignore me. Thanks @acw1668
– DeathResister
Mar 25 at 22:23
You already know how to get the value of the entry:v.get()
.
– acw1668
Mar 25 at 23:01
add a comment |
I am looking to make a theme park ticketing program in tkinter, i have already made it in python 3 but i am trying to implement it into tkinter. However, I am unsure on how to set a variable based off a user input in tkinter. I want the program to ask the the user to input an integer for the amount of tickets they would like to buy, this would lead to a variable which can then calculate a cost depending on how many tickets they want. Mainly i would like an input to be taken when they press a button, this would result in a new frame showing. One last thing would be that I have heard maybe using a spinbox to do this would be more effective but i am not really, however, if any of you know how to implement a spin box into my program it would be really helpful.
class PageAdultTickets(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg="red")
self.controller = controller
label1 = tk.Label(self, text="------------- Welcome to Fantasialand Ticket Station ------------", fg="Blue", font=controller.title_font)
label1.pack(side="top", fill="x", pady=10)
label2 = tk.Label(self, text=f"The price of 1 adult ticket is £adultTicket:0.2f", fg="steelblue", bg="yellow", font=controller.title_font)
label2.pack(side="top", fill="x", pady=5)
button1 = tk.Button(self, text="Go to Main Menu",
command=lambda: controller.show_frame("MainMenu"))
button1.pack(side="right")
v = tk.IntVar()
amAdultTickets = tk.Entry(self, textvariable=v)
amAdultTickets.pack(side="bottom")
s = v.get()
Thanks to everyone who tries to help!
python python-3.x tkinter
I am looking to make a theme park ticketing program in tkinter, i have already made it in python 3 but i am trying to implement it into tkinter. However, I am unsure on how to set a variable based off a user input in tkinter. I want the program to ask the the user to input an integer for the amount of tickets they would like to buy, this would lead to a variable which can then calculate a cost depending on how many tickets they want. Mainly i would like an input to be taken when they press a button, this would result in a new frame showing. One last thing would be that I have heard maybe using a spinbox to do this would be more effective but i am not really, however, if any of you know how to implement a spin box into my program it would be really helpful.
class PageAdultTickets(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg="red")
self.controller = controller
label1 = tk.Label(self, text="------------- Welcome to Fantasialand Ticket Station ------------", fg="Blue", font=controller.title_font)
label1.pack(side="top", fill="x", pady=10)
label2 = tk.Label(self, text=f"The price of 1 adult ticket is £adultTicket:0.2f", fg="steelblue", bg="yellow", font=controller.title_font)
label2.pack(side="top", fill="x", pady=5)
button1 = tk.Button(self, text="Go to Main Menu",
command=lambda: controller.show_frame("MainMenu"))
button1.pack(side="right")
v = tk.IntVar()
amAdultTickets = tk.Entry(self, textvariable=v)
amAdultTickets.pack(side="bottom")
s = v.get()
Thanks to everyone who tries to help!
python python-3.x tkinter
python python-3.x tkinter
edited Mar 24 at 23:21
DeathResister
asked Mar 24 at 23:16
DeathResisterDeathResister
224
224
Tkinter Spinbox, tkinter Entry. Hope they help.
– Artemis Fowl
Mar 24 at 23:47
I've already looked at these, i still have a problem of getting the input and making it a variable.
– DeathResister
Mar 25 at 8:08
You have asked same question before and got comments that it is wrong to get the value of the entry just after it is created. You need to, for example, create another button that triggers a function to get the value and perform required calculation.
– acw1668
Mar 25 at 12:03
Yes, but exactly like I said, What is the command to get the entry, telling me my problem which i am fully aware of is not helping at all, I asked it before because i got no genuine response and you posting your very unhelpful question is not going to make me want to post again. So kindly either help me or ignore me. Thanks @acw1668
– DeathResister
Mar 25 at 22:23
You already know how to get the value of the entry:v.get()
.
– acw1668
Mar 25 at 23:01
add a comment |
Tkinter Spinbox, tkinter Entry. Hope they help.
– Artemis Fowl
Mar 24 at 23:47
I've already looked at these, i still have a problem of getting the input and making it a variable.
– DeathResister
Mar 25 at 8:08
You have asked same question before and got comments that it is wrong to get the value of the entry just after it is created. You need to, for example, create another button that triggers a function to get the value and perform required calculation.
– acw1668
Mar 25 at 12:03
Yes, but exactly like I said, What is the command to get the entry, telling me my problem which i am fully aware of is not helping at all, I asked it before because i got no genuine response and you posting your very unhelpful question is not going to make me want to post again. So kindly either help me or ignore me. Thanks @acw1668
– DeathResister
Mar 25 at 22:23
You already know how to get the value of the entry:v.get()
.
– acw1668
Mar 25 at 23:01
Tkinter Spinbox, tkinter Entry. Hope they help.
– Artemis Fowl
Mar 24 at 23:47
Tkinter Spinbox, tkinter Entry. Hope they help.
– Artemis Fowl
Mar 24 at 23:47
I've already looked at these, i still have a problem of getting the input and making it a variable.
– DeathResister
Mar 25 at 8:08
I've already looked at these, i still have a problem of getting the input and making it a variable.
– DeathResister
Mar 25 at 8:08
You have asked same question before and got comments that it is wrong to get the value of the entry just after it is created. You need to, for example, create another button that triggers a function to get the value and perform required calculation.
– acw1668
Mar 25 at 12:03
You have asked same question before and got comments that it is wrong to get the value of the entry just after it is created. You need to, for example, create another button that triggers a function to get the value and perform required calculation.
– acw1668
Mar 25 at 12:03
Yes, but exactly like I said, What is the command to get the entry, telling me my problem which i am fully aware of is not helping at all, I asked it before because i got no genuine response and you posting your very unhelpful question is not going to make me want to post again. So kindly either help me or ignore me. Thanks @acw1668
– DeathResister
Mar 25 at 22:23
Yes, but exactly like I said, What is the command to get the entry, telling me my problem which i am fully aware of is not helping at all, I asked it before because i got no genuine response and you posting your very unhelpful question is not going to make me want to post again. So kindly either help me or ignore me. Thanks @acw1668
– DeathResister
Mar 25 at 22:23
You already know how to get the value of the entry:
v.get()
.– acw1668
Mar 25 at 23:01
You already know how to get the value of the entry:
v.get()
.– acw1668
Mar 25 at 23:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329501%2ftkinter-how-to-set-a-variable-based-off-an-entrybox-user-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55329501%2ftkinter-how-to-set-a-variable-based-off-an-entrybox-user-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Tkinter Spinbox, tkinter Entry. Hope they help.
– Artemis Fowl
Mar 24 at 23:47
I've already looked at these, i still have a problem of getting the input and making it a variable.
– DeathResister
Mar 25 at 8:08
You have asked same question before and got comments that it is wrong to get the value of the entry just after it is created. You need to, for example, create another button that triggers a function to get the value and perform required calculation.
– acw1668
Mar 25 at 12:03
Yes, but exactly like I said, What is the command to get the entry, telling me my problem which i am fully aware of is not helping at all, I asked it before because i got no genuine response and you posting your very unhelpful question is not going to make me want to post again. So kindly either help me or ignore me. Thanks @acw1668
– DeathResister
Mar 25 at 22:23
You already know how to get the value of the entry:
v.get()
.– acw1668
Mar 25 at 23:01