Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > in python , could I accomplish the purpose that "a=Console.read()" used in C?

Reply
Thread Tools

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

 
 
python
Guest
Posts: n/a
 
      06-04-2006
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.

 
Reply With Quote
 
 
 
 
Dennis Benzinger
Guest
Posts: n/a
 
      06-04-2006
python wrote:
> 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
 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      06-05-2006
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)
 
Reply With Quote
 
Ravi Teja
Guest
Posts: n/a
 
      06-05-2006

Bruno Desthuilliers wrote:
> 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>


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

 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      06-05-2006
Ravi Teja a écrit :
> Bruno Desthuilliers wrote:
>
>>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>

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

Yeps. Or may be MS-C++ too AFAICT.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Best method to accomplish? Biffo ASP .Net 0 02-03-2005 06:10 PM
design question about collections, or how to accomplish glunk Java 4 06-30-2004 06:31 PM
what could you accomplish with a degree? Augustine Kaplan Python 0 05-19-2004 11:53 AM
Newbie question: How to accomplish an HTTP Post in ASP.NET shland ASP .Net 4 10-20-2003 09:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57