473,698 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.

Jun 4 '06 #1
4 1820
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
Jun 4 '06 #2
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)
Jun 4 '06 #3

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.

Jun 5 '06 #4
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.
Jun 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3417
by: Askari | last post by:
Yesterday, ALL code in python work and nothing when I close(finish) a code. Today, when I close, some raise this windows error : Instruction at "0x00FC3D70" use memory address "0x00000000". Can't be "read". Click on "OK" to exit program. Why this error, today and not before today?
10
2283
by: ZafT | last post by:
Thanks in advance for any tips that might get me going in the right direction. I am working on a simple exercise for school that is supposed to use read to read a file (about 10 MB). I am supposed to change the buffer size and see how this affects the read time. In other words, the buffer is supposed to limit how much of the file gets read per call, and cause some change in speed. I am supposed to do the same with fread as well, but...
4
30363
by: Kerwin Cabrera | last post by:
I am writing a console application and I would like to put a "Press any key..." message once the program is done executing. Currently, when it executes it returns to the prompt. I have tried console.read and console.readline but they both require an <Enter> key to be hit. Any suggestions Thanks -KC
0
1245
by: Ross Marchant | last post by:
Hi all, I wrote a simple server console application, and i notice that if I click on the console window is stops processing because the window is in a text select mode. Is there anyway to turn off this select mode. BTW VC# 2005 express on Win 2000. Ross
1
1869
by: Gary | last post by:
Hi, I would like to display a form and draw some line graphics on the form, and do all of this from a "console" program. I would like control to remain with the console program before, during, and after the form is displayed (i.e. I don't want to switch to an event driven model). Is there a way to do this? Is there some sample code available that demonstrates this?
1
1306
by: cool2005 | last post by:
I am new to Opera and tried to use its "javascipt console" and only saw "Java console" and "Error console" under tools|advance. Any idea? thanks mark
3
2919
by: Jerry | last post by:
I have created an application using wxPython and compiled it using py2exe. When I put setup(console=) in my setup.py file, the resulting application runs just fine. But when I change it to setup(windows=)
1
2324
by: Kerem Gümrükcü | last post by:
Hi All, i am too tired now to find this out by my own, but why does my while loop "while(readline==Console.ReadLine())" needs twice return hit to read the line, after setting "Console.TreatControlCAsInput = true". How can i make it work like it would be set to "false", so that i only must hit the return once to get the input,... TIA
3
6551
by: Curious | last post by:
I''ve created a simple Console Application in C#.NET (.NET 2.0), and I have the following code: Console.WriteLine("Now let us begin!"); However, the string, "Now let us begin!", never shows up in the "View"- FYI, the text in the "View"->"Output" window is below instead: 'IO.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL
0
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8855
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.