473,383 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Reading standard input

The program shows a license text, then the user has to accept the
license (or not).
Is there another way to get text from console? (that using
sys.stdin.read)

foo = sys.stdin.read(3)
if foo != 'yes'
sys.exit(0)

I also would to trap the KeyboardInterrupt for that doesn't show that
message. How would it be possible?

Oct 28 '06 #1
1 1337
MindClass wrote:
The program shows a license text, then the user has to accept the
license (or not).
Is there another way to get text from console? (that using
sys.stdin.read)
http://effbot.org/pyref/raw_input.htm
I also would to trap the KeyboardInterrupt for that doesn't show that
message. How would it be possible?
any reason you cannot use an ordinary try-except for that?

</F>
Oct 28 '06 #2

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

Similar topics

1
by: fabrice | last post by:
Hello, I've got trouble reading a text file (event viewer dump) by using the getline() function... After 200 - 300 lines that are read correctly, it suddenly stops reading the rest of the...
6
by: Gus Tabares | last post by:
Hello, I'm having trouble reading in a character. Here is a snippet of code: int num; char character; printf("Enter a number: "); scanf("%d", &num); printf("You entered %d.\n", num);
0
by: Miha | last post by:
I wrote a simple Windows Application based application in C# called the CallWebServiceGui. This application is started from a different application called WsGuiStarter. The WsGuiStarter redirects...
3
by: Joakim Hove | last post by:
Hello, I am reading a filename from the user - the loop is typically like this: 1. Read a directory from the user. 2. Read several filenames from the user. The filenames read in 2. above...
3
by: NaN | last post by:
Hi I'm using Dev-C++. Here is my sourcecode. /* GETCH.C: This program reads characters from * the keyboard until it receives a 'Y' or 'y'. */ #include <conio.h>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.