0

I am trying to take user input during python script run so I can use it as variable. I can use input() but I want to make a popup dialog box that asks for user input to give it a nice touch. I used easygui library and it does create a popup but after providing input it crashes python. Is there is a simple and elegant way to ask for user input without crashing python?

import easygui
pathname=easygui.enterbox('What is the path name where you want to store file? ')
filename=easygui.enterbox('What is the file you want to use?')
print("the whole file path name is :"+pathname+filename+'.xlsx')
  • Does it "crash" after the first input, or the second? When you say "crash" do you mean that the Python interpreter itself dumps core, or that the script exits? Is there any traceback? – Samwise Mar 27 '22 at 19:05
  • After the first input it asks me to enter the second input and as soon as I press ok nothing happens. I cant click the cancel button, cant click the ok button, cant change the value that i enterted in the box. Activity monitor says “ python unresponsive’. So i have to end process to get the loading state to end. – Anurag Gupta Mar 28 '22 at 16:11
  • Hm, works fine for me. Maybe try Ctrl-C in the terminal and check the stack trace to see where it was stuck? – Samwise Mar 28 '22 at 16:40
  • Also, I am on Mac OS. Could that be a problem? – Anurag Gupta Mar 28 '22 at 18:20
  • Doesn't seem like it should be. – Samwise Mar 28 '22 at 20:31

0 Answers0