Can you do something like the following:
nombre = raw_input("cual es tu nombre?")
so that it takes the user's response from a textfield
or from the console?
Can you do something like the following:
nombre = raw_input("cual es tu nombre?")
so that it takes the user's response from a textfield
or from the console?
To assign the content of a
UITextField
single you have to use the propertytext
:If what you want is to execute a script in the console, there is no method to directly read a value from the keyboard, but it is possible to implement it in the following way:
And run it with
You need to run this example as a script, it doesn't work in playgrounds.
Code to read from keyboard originally appears here
I see I can do something like this to use it with Xcode:
In this way I formulate what I want to ask in it
textfield
. Although for console it is not worth clear.In this way I get it to work for me from the same Xcode and I can enter the value without error through the console, it is practically the same code as the previous one but changing a few things.