Program is only opening the GUI when I'm in debugging modeIs functional GUI programming possible?ttk tkinter multiple frames/windowsWhen do I need to call mainloop in a Tkinter application?Making dynamic list of option menus with invidual variableHow do i get the value of an item in tkinter when using a class?Function works only in Debug Mode MATLAB GUIpython TypeError when using OptionMenu TkinterTkinter OptionMenu widget is not displaying valuesPython tkinter: Getting the number of entries in an OptionMenu dropdown listtkinter, print text when hovering over OptionMenu objects

Modulus Operandi

Should disabled buttons give feedback when clicked?

Matchmaker, Matchmaker, make me a match

Why didn't Thanos kill all the Dwarves on Nidavellir?

What is this triple-transistor arrangement called?

Keep milk (or milk alternative) for a day without a fridge

Would dual wielding daggers be a viable choice for a covert bodyguard?

Can a Beast Master ranger have its beast chase down and attack enemies?

How did the hit man miss?

Why are Hobbits so fond of mushrooms?

What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?

Mathematica notebook opening off the screen

Has anyone in space seen or photographed a simple laser pointer from Earth?

Cracking the Coding Interview — 1.5 One Away

How to ask for a LinkedIn endorsement?

How is angular momentum conserved for the orbiting body if the centripetal force disappears?

Why queuable apex accepts sobjects where as future methods doesn't?

Why doesn't sea level show seasonality?

Single word for "refusing to move to next activity unless present one is completed."

Multiple DUI convictions 12 years ago. Do I disclose if I know they will do a background check?

Is the genetic term "polycistronic" still used in modern biology?

Constructive proof of existence of free algebras for infinitary equational theories

Are randomly-generated passwords starting with "a" less secure?

Integer Lists of Noah



Program is only opening the GUI when I'm in debugging mode


Is functional GUI programming possible?ttk tkinter multiple frames/windowsWhen do I need to call mainloop in a Tkinter application?Making dynamic list of option menus with invidual variableHow do i get the value of an item in tkinter when using a class?Function works only in Debug Mode MATLAB GUIpython TypeError when using OptionMenu TkinterTkinter OptionMenu widget is not displaying valuesPython tkinter: Getting the number of entries in an OptionMenu dropdown listtkinter, print text when hovering over OptionMenu objects






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to create a drop down menu using a string from a file which I;m reading in. That part works. However, I'm trying to build the GUI using tkinter and it will only open in debugging mode. When it does open, it works. What is going on?



master = Tk()

with open('player_names.csv','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
next (plots)
for row in plots:
number.append((row[0]))
first.append(row[1])
last.append(row[2])

variable = StringVar(master)
variable.set(number[0]) # default value

w = OptionMenu(master, variable, *number)
w.pack()

def ok():
print ("value is:" + variable.get())

button = Button(master, text="OK", command=ok)
button.pack()

mainloop()


When it works correctly, the GUI opens and there is a little drop down menu with all of the values from number[]. It just won't open.










share|improve this question
























  • What are you running to start it, both ways? Maybe you are running it from different working directories so it is not finding your csv.

    – Matt Clark
    Mar 26 at 2:32











  • @MattClark I'm using Wing. I'm just running it like I always do. I built another GUI with tkinter and it worked just fine.

    – andrewalmosthasaclue
    Mar 26 at 2:42











  • Maybe simply adding some logging statements to see the working directory of your application, and if it loaded the file properly?

    – Matt Clark
    Mar 26 at 2:47











  • @MattClark the file is loading correctly. If I manually define the string, it still wont open when I just run it, but will in debug mode.

    – andrewalmosthasaclue
    Mar 26 at 2:55











  • @andrewalmosthasaclue I have tested your code in my Wing IDE (after adding the missing declaration of number, first, last) and it works whether it is in debug mode or not.

    – acw1668
    Mar 26 at 7:58

















0















I'm trying to create a drop down menu using a string from a file which I;m reading in. That part works. However, I'm trying to build the GUI using tkinter and it will only open in debugging mode. When it does open, it works. What is going on?



master = Tk()

with open('player_names.csv','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
next (plots)
for row in plots:
number.append((row[0]))
first.append(row[1])
last.append(row[2])

variable = StringVar(master)
variable.set(number[0]) # default value

w = OptionMenu(master, variable, *number)
w.pack()

def ok():
print ("value is:" + variable.get())

button = Button(master, text="OK", command=ok)
button.pack()

mainloop()


When it works correctly, the GUI opens and there is a little drop down menu with all of the values from number[]. It just won't open.










share|improve this question
























  • What are you running to start it, both ways? Maybe you are running it from different working directories so it is not finding your csv.

    – Matt Clark
    Mar 26 at 2:32











  • @MattClark I'm using Wing. I'm just running it like I always do. I built another GUI with tkinter and it worked just fine.

    – andrewalmosthasaclue
    Mar 26 at 2:42











  • Maybe simply adding some logging statements to see the working directory of your application, and if it loaded the file properly?

    – Matt Clark
    Mar 26 at 2:47











  • @MattClark the file is loading correctly. If I manually define the string, it still wont open when I just run it, but will in debug mode.

    – andrewalmosthasaclue
    Mar 26 at 2:55











  • @andrewalmosthasaclue I have tested your code in my Wing IDE (after adding the missing declaration of number, first, last) and it works whether it is in debug mode or not.

    – acw1668
    Mar 26 at 7:58













0












0








0








I'm trying to create a drop down menu using a string from a file which I;m reading in. That part works. However, I'm trying to build the GUI using tkinter and it will only open in debugging mode. When it does open, it works. What is going on?



master = Tk()

with open('player_names.csv','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
next (plots)
for row in plots:
number.append((row[0]))
first.append(row[1])
last.append(row[2])

variable = StringVar(master)
variable.set(number[0]) # default value

w = OptionMenu(master, variable, *number)
w.pack()

def ok():
print ("value is:" + variable.get())

button = Button(master, text="OK", command=ok)
button.pack()

mainloop()


When it works correctly, the GUI opens and there is a little drop down menu with all of the values from number[]. It just won't open.










share|improve this question
















I'm trying to create a drop down menu using a string from a file which I;m reading in. That part works. However, I'm trying to build the GUI using tkinter and it will only open in debugging mode. When it does open, it works. What is going on?



master = Tk()

with open('player_names.csv','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
next (plots)
for row in plots:
number.append((row[0]))
first.append(row[1])
last.append(row[2])

variable = StringVar(master)
variable.set(number[0]) # default value

w = OptionMenu(master, variable, *number)
w.pack()

def ok():
print ("value is:" + variable.get())

button = Button(master, text="OK", command=ok)
button.pack()

mainloop()


When it works correctly, the GUI opens and there is a little drop down menu with all of the values from number[]. It just won't open.







python user-interface tkinter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 2:30









Matt Clark

18.5k10 gold badges49 silver badges100 bronze badges




18.5k10 gold badges49 silver badges100 bronze badges










asked Mar 26 at 2:27









andrewalmosthasaclueandrewalmosthasaclue

155 bronze badges




155 bronze badges












  • What are you running to start it, both ways? Maybe you are running it from different working directories so it is not finding your csv.

    – Matt Clark
    Mar 26 at 2:32











  • @MattClark I'm using Wing. I'm just running it like I always do. I built another GUI with tkinter and it worked just fine.

    – andrewalmosthasaclue
    Mar 26 at 2:42











  • Maybe simply adding some logging statements to see the working directory of your application, and if it loaded the file properly?

    – Matt Clark
    Mar 26 at 2:47











  • @MattClark the file is loading correctly. If I manually define the string, it still wont open when I just run it, but will in debug mode.

    – andrewalmosthasaclue
    Mar 26 at 2:55











  • @andrewalmosthasaclue I have tested your code in my Wing IDE (after adding the missing declaration of number, first, last) and it works whether it is in debug mode or not.

    – acw1668
    Mar 26 at 7:58

















  • What are you running to start it, both ways? Maybe you are running it from different working directories so it is not finding your csv.

    – Matt Clark
    Mar 26 at 2:32











  • @MattClark I'm using Wing. I'm just running it like I always do. I built another GUI with tkinter and it worked just fine.

    – andrewalmosthasaclue
    Mar 26 at 2:42











  • Maybe simply adding some logging statements to see the working directory of your application, and if it loaded the file properly?

    – Matt Clark
    Mar 26 at 2:47











  • @MattClark the file is loading correctly. If I manually define the string, it still wont open when I just run it, but will in debug mode.

    – andrewalmosthasaclue
    Mar 26 at 2:55











  • @andrewalmosthasaclue I have tested your code in my Wing IDE (after adding the missing declaration of number, first, last) and it works whether it is in debug mode or not.

    – acw1668
    Mar 26 at 7:58
















What are you running to start it, both ways? Maybe you are running it from different working directories so it is not finding your csv.

– Matt Clark
Mar 26 at 2:32





What are you running to start it, both ways? Maybe you are running it from different working directories so it is not finding your csv.

– Matt Clark
Mar 26 at 2:32













@MattClark I'm using Wing. I'm just running it like I always do. I built another GUI with tkinter and it worked just fine.

– andrewalmosthasaclue
Mar 26 at 2:42





@MattClark I'm using Wing. I'm just running it like I always do. I built another GUI with tkinter and it worked just fine.

– andrewalmosthasaclue
Mar 26 at 2:42













Maybe simply adding some logging statements to see the working directory of your application, and if it loaded the file properly?

– Matt Clark
Mar 26 at 2:47





Maybe simply adding some logging statements to see the working directory of your application, and if it loaded the file properly?

– Matt Clark
Mar 26 at 2:47













@MattClark the file is loading correctly. If I manually define the string, it still wont open when I just run it, but will in debug mode.

– andrewalmosthasaclue
Mar 26 at 2:55





@MattClark the file is loading correctly. If I manually define the string, it still wont open when I just run it, but will in debug mode.

– andrewalmosthasaclue
Mar 26 at 2:55













@andrewalmosthasaclue I have tested your code in my Wing IDE (after adding the missing declaration of number, first, last) and it works whether it is in debug mode or not.

– acw1668
Mar 26 at 7:58





@andrewalmosthasaclue I have tested your code in my Wing IDE (after adding the missing declaration of number, first, last) and it works whether it is in debug mode or not.

– acw1668
Mar 26 at 7:58












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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349002%2fprogram-is-only-opening-the-gui-when-im-in-debugging-mode%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




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349002%2fprogram-is-only-opening-the-gui-when-im-in-debugging-mode%23new-answer', 'question_page');

);

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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript