1、urllib模块 1.urllib.urlopen(url[,data[,proxies]]) 打开一个url的方法,返回一个文件对象,然后可以进行类似文件对象的操作。本例试着打开google urlopen返回对象提供方法: - read() , readline() ,readlines() ...
分类:
编程语言 时间:
2016-04-22 11:55:43
阅读次数:
248
Console.WriteLine("请输入你的身份证号码:"); string a = Console.ReadLine(); int year = Convert.ToInt32(a.Substring(6, 4)); int month = Convert.ToInt32(a.Substrin ...
分类:
其他好文 时间:
2016-04-21 15:19:43
阅读次数:
132
int[] xs = new int[10]; int [] cj=new int [3]; for (int i=0;i<10 ;i++ ) { Console.Write("请输入{0}号学生的成绩:",i+1); xs[i] = Convert.ToInt32(Console.ReadLine ...
分类:
其他好文 时间:
2016-04-20 09:24:45
阅读次数:
157
static void Main22(string[] args) { //菱形 Console.WriteLine("请输入腰长:"); int n = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i <n; i++) { for (i ...
int fenshu; string zuoye; Console.WriteLine("输入成绩:"); fenshu = Convert .ToInt32 ( Console.ReadLine()); if (fenshu <60) { Console.WriteLine("是否认真做作业,(是 ...
分类:
其他好文 时间:
2016-04-17 11:46:13
阅读次数:
143
//求和 int a = Convert.ToInt32(Console.ReadLine()); int c = 0; for (int b = 0; b <= a; b++) { c = c + b; } Console.Write(c); //阶乘 int a = Convert.ToInt3 ...
分类:
其他好文 时间:
2016-04-16 17:04:16
阅读次数:
166
Console.Write("请输入到达了第几节楼梯"); int a = Convert.ToInt32(Console.ReadLine()); int end = 0; if (a >= 0 && a <= 49) { for (int b = 0; b <= a; b++) { end = ...
分类:
其他好文 时间:
2016-04-16 16:34:29
阅读次数:
147
Console.WriteLine("这是一个计算纳税金额的程序\n请输入金额:"); Console.Write("金额"); double ygz = Convert.ToInt32(Console.ReadLine()); if (ygz > 3500) { double je = ygz - ...
分类:
其他好文 时间:
2016-04-16 13:55:25
阅读次数:
111
平常Coding过程中,经常使用到的with场景是(打开文件进行文件处理,然后隐式地执行了文件句柄的关闭,同样适合socket之类的,这些类都提供了对with的支持): with file('test.py','r') as f : print f.readline() with的作用,类似try. ...
分类:
编程语言 时间:
2016-04-15 13:35:44
阅读次数:
220
Console.WriteLine("老张开车去东北。"); string a=Console.ReadLine(); if(a=="撞了") { Console.WriteLine("肇事司机耍流氓。"); string b=Console .ReadLine(); if(b=="跑了") { C ...
分类:
其他好文 时间:
2016-04-14 12:06:06
阅读次数:
218