#!/usr/bin/python
a="a.txt"
f=file(a)
c=f.readlines()
whileTrue:
user_input=raw_input("plzinputyourname:").strip()
iflen(user_input)==0:continue
forlineinc:
ifuser_inputinline:
printline,
break
else:
print"itisnottheuser"
分类:
编程语言 时间:
2015-07-02 01:15:45
阅读次数:
154
1 DECLARE t_error INTEGER DEFAULT 0; 2 DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET t_error=1; 3 START TRANSACTION; 7 d...
分类:
数据库 时间:
2015-07-01 17:34:03
阅读次数:
178
1 for(p = fmt; *p; p++) 2 { 3 if(*p != '%') 4 { 5 putchar(*p); 6 continue; 7 } 8 i = ...
分类:
其他好文 时间:
2015-07-01 12:02:48
阅读次数:
114
trymysql --force < sample_data.sql Mysql help section says-f, --force Continue even if we get an sql error.----------------------You could also use IN...
分类:
数据库 时间:
2015-07-01 09:47:03
阅读次数:
146
#-*-coding:utf-8-*-
importsys
user="wangru"
counter=0
whileTrue:
ifcounter<3:
name=raw_input("pleaseinputyourname:").strip()
iflen(name)==0:
print"thenameisnull,tryagain"
continue
elifname==user:
pass
else:
print"theuser%sisnotrighttryagain"%name
coun..
分类:
编程语言 时间:
2015-07-01 06:24:31
阅读次数:
163
引入异常处理机制,使得运行的程序发生错误时,不至于崩溃。常见格式:try:
command1
except:
command2当command1执行出错时,就会执行command2。command2通常是自己定义的错误提示或者系统默认的提示。eg:#!/usr/bin/python
while1:
c=raw_input("input‘c‘continue,otherwis..
分类:
编程语言 时间:
2015-06-29 20:38:14
阅读次数:
186
[root@yonglinux~]#catguess.sh
#!/bin/bash
#guessnumbergame;
n=$[$RANDOM%100]
while:
do
read-p"pleaseinputanumber:"n1
n2=`echo$n1|sed‘s/[0-9]//g‘`
if[!-z$n2]
then
echo"yournumberisnotanumber."
continue
fi
if[$n1==$n]
then
echo"youareallright."
break
elif[$n1..
分类:
系统相关 时间:
2015-06-28 20:19:16
阅读次数:
539
break和continue
这两个命令分别用来退出循环,或跳到循环体的其他地方.
使用while与break,等待用户登录
bash代码:
printf “Enter username: ”
read user
while true
do
if who | grep “$user” >/dev/null
then
break;
fi
sleep 30
done
...
分类:
系统相关 时间:
2015-06-28 12:42:40
阅读次数:
119
1) 安装WingIDE成功后启动,激活时输入license id CN123-12345-12345-123452) 点击Continue后弹框,拷贝框中的request code3) 修改Python脚本中的Request Code为刚才得到的Request Code值,运行脚本后得到激活码,填...
分类:
Windows程序 时间:
2015-06-26 01:41:53
阅读次数:
3599
1、下载地址为http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html直接Download,然后跳转页面选择Platform 中的Linux下载,我没有注册,直接点Continue进入下一个...
分类:
系统相关 时间:
2015-06-25 16:54:16
阅读次数:
204