in python , could I accomplish the purpose that "a=Console.read()" used in C?

P

python

in python , could I accomplish the purpose that "a=Console.read()" used
in C?
when program is running, I wanna add a statement like
"a=Console.read()" in C language,it will wait for user's input, after
user's typing a character , and click "enter" key, the program will go
on running.
 
D

Dennis Benzinger

python said:
in python , could I accomplish the purpose that "a=Console.read()" used
in C?
when program is running, I wanna add a statement like
"a=Console.read()" in C language,it will wait for user's input, after
user's typing a character , and click "enter" key, the program will go
on running.


Use raw_input() <http://docs.python.org/lib/built-in-funcs.html>:

age = raw_input("Your age: ")
print age


Bye,
Dennis
 
B

Bruno Desthuilliers

python a écrit :
in python , could I accomplish the purpose that "a=Console.read()" used
in C?

<ot mode='pedantic'>
There's nothing like "Console.read()" in ansi-C.
</ot>

(see Dennis's post for the answer to your question)
 
R

Ravi Teja

Bruno said:
python a écrit :

<ot mode='pedantic'>
There's nothing like "Console.read()" in ansi-C.
</ot>

He probably got it mixed up with C# which ( almost - Console.Read() )
has that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top