摘要: 1 #!/bin/python 2 #_*_coding:utf8_*_ 3 4 from sqlalchemy import * 5 from sqlalchemy.orm import * 6 engine=create_engine("sqlite:///./car.db") 7 metadata=MetaData() 8 9 car=Table('car',metadata,10 Column('carID',Integer,primary_key=True),11 Column('tyreID1',Integer,F 阅读全文
posted @ 2011-12-15 14:47 zbz092050 阅读(573) 评论(0) 推荐(0) 编辑
摘要: #!/user/bin/python# -*- encoding:utf-8 -*-from sqlalchemy import *from sqlalchemy.orm import *engine=create_engine("sqlite:///./test.db")metadata=MetaData()party=Table('party',metadata, Column('id',Integer,primary_key=True), Column('name',String(32),nullable=False), 阅读全文
posted @ 2011-12-13 19:01 zbz092050 阅读(1319) 评论(0) 推荐(0) 编辑
摘要: 1 #!/user/bin/python 2 #_*_coding:utf8_*_ 3 from sqlalchemy import * 4 from sqlalchemy.orm import * 5 #创建一个引擎 6 engine=create_engine("sqlite:///./test.db") 7 #指定源数据 8 metadata=MetaData() 9 #定义一个Table类,命名为party10 party=Table('party',metadata,11 Column('id',Integer,primary_ke 阅读全文
posted @ 2011-12-13 17:05 zbz092050 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1、tuple使用1 #!/user/loacl/bin/python2 a = (1,4,5,-10, 11)3 b = (7,)4 print a[2]5 print b[0]2、for语句使用#!/user/local/bin/pythonfor a in range(1, 10): print aa = "qwert"for c in a: print ca = range(0 , 11,5)print ab = range(1,1000)print b3、haskey使用 1 #!/user/loacl/bin/python 2 a = { 3 "... 阅读全文
posted @ 2011-12-13 13:17 zbz092050 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1、if语句 1 #!/user/local/bin/python 2 a = 1 3 b = 2 4 if a < b: 5 pass 6 else: 7 print a 8 print "-----" 9 10 a = '+'11 if a == '+':12 print "+"13 elif a == '-':14 print "-"15 print "-----"16 17 a = 118 b = 219 c = 320 if b >= a and 阅读全文
posted @ 2011-12-13 13:11 zbz092050 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 1 #!/bin/bash 2 #ceshi.sh 3 function login() { 4 i=3 5 while [ $i -gt 0 ] 6 do 7 echo "---->您还有 $i 次机会,请好好把握" 8 echo -e " 登录姓名:\c" 9 read YourName10 echo -e " 登录密码:\c "11 read YourPwd12 if [ "$YourName" = "zbz" ] && [ "$YourPwd" 阅读全文
posted @ 2011-12-13 13:04 zbz092050 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1 #!/bin/sh 2 #shellThird.sh 3 # to show the method of if 4 echo -n "Enter the first integer:" 5 read First 6 echo -n "Enter the second integer:" 7 read Second 8 if [ "$First" -gt "$Second" ] 9 then10 echo "$First is greater than $Second"11 elif [ &q 阅读全文
posted @ 2011-12-13 13:00 zbz092050 阅读(867) 评论(0) 推荐(0) 编辑
摘要: 1 #!/bin/bash 2 3 var=`date +%Y%m%d%H%M%S`.sh 4 5 #判断'(',')'是否匹配 6 function CheckYuan(){ 7 #获得要编译的文件的行数 8 row=$(awk ' 9 END { print FNR }' $1) 10 #i用于标记遍历编译文件行数 11 i=1 12 #用于记录全局的存储剩余{d的个数 13 symbleCount=0 14 #用于统计前i行的剩余{的个数 15 count=0 16 #遍历编译文件的每一行 17 while [ $i -le $row ] 阅读全文
posted @ 2011-12-13 12:58 zbz092050 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <setjmp.h> 3 jmp_buf ebuf; 4 void fun(void); 5 int main(){ 6 int i = setjmp(ebuf); 7 if(i == 0) 8 { 9 printf( "first\n" );10 fun();11 }12 else13 {14 printf( "second\n");15 ... 阅读全文
posted @ 2011-12-13 12:45 zbz092050 阅读(140) 评论(0) 推荐(0) 编辑