How to input value into python script?


#1

I’m trying to learn python and have written this simple program:

name = input ("enter your name: ")
print ("hello " + name + “!”)

But when i run it with Script, nothing pops up in the window below. What can i do?


#2

The easiest thing to do (and most educational) is run it in the terminal.

So, in the terminal, navigate to the file’s directory and run python file_name


#3

script does not have the ability to handle user input. At this point, your best option is to use a terminal package.


#4

How do i open the terminal?


#5

Which OS do you have?
I think @Aerijo was thinking of that terminal.

If you have Windows, it is also called “command prompt” (cmd). “powershell” will can also work. Note that Python should be available in the globally. Search the search terms “path python windows” here in this forum or in your favourite web search-engine.