1 #author F 2 3 import sys,time 4 5 6 f = open("file", "r", encoding="utf-8") 7 8 print(f.tell()) 9 print(f.readline().rstrip()) 10 print(f.read(5)) 1... ...
分类:
编程语言 时间:
2017-06-13 11:28:16
阅读次数:
210
1、ipconfig /flushdns的作用 ipconfig /flushdns 这是清除DNS缓存用的。 当訪问一个站点时系统将从DNS缓存中读取该域名所相应的IP地址。当查找不到时就会到系统中查找hosts文件,假设还没有那么才会向DNSserver请求一个DNS查询,DNSserver将返 ...
分类:
其他好文 时间:
2017-06-12 13:07:32
阅读次数:
234
//ArrayList //ArrayList alt = new ArrayList(); //alt.Add("123"); //alt.Add(123); //alt.Add(true); //bool iscontain = alt.Contains("1"); //alt.Clear(); ...
分类:
其他好文 时间:
2017-06-12 13:05:45
阅读次数:
168
随机数: string[] str = new string[4]{"a","b","c","d"} Readom r = new Readom(); int a = r.Next(0,str.length); 获得一个随机数,从零开始,返回int a console.writeLine(str[a ...
分类:
编程语言 时间:
2017-06-11 17:22:18
阅读次数:
183
MySQL备份还原 简单测试示例 注:这里为了方便,将数据库名称、用户名、密码、备份的文件名称、位置和还原的文件名称、位置硬编码 在实际中,建议写入配置文件,以下为测试示例代码 ...
分类:
数据库 时间:
2017-06-11 10:11:26
阅读次数:
260
使用emacs的用户都知道,一般要打开远程机器上的文件要使用TrampMode模式,调用方式例如以下: C-x C-f /remotehost:filename RET (or /method:user@remotehost:filename) 但,这样打开有点麻烦,你必要输入username和机器 ...
分类:
系统相关 时间:
2017-06-10 22:43:02
阅读次数:
363
python 文件对象不仅可以访问普通磁盘文件,也可以访问抽象层面上的文件对象(例如URL地址) 打开文件open() file()功能一致可以任意替代 输入: 输出: 文件内移动 对文件进行操作完后一定要记得关闭文件fp.close() ...
分类:
编程语言 时间:
2017-06-10 21:24:24
阅读次数:
206
#coding:utf-8 from numpy import * import matplotlib import matplotlib.pyplot as plt def loadData(filename): fr=open(filename) dataset=[] datalabel=[] ... ...
分类:
编程语言 时间:
2017-06-10 20:32:41
阅读次数:
305
今天上午学习C#循环。 经典练习题: * *** ***** ******* ***** *** * 打印如上菱形。 基本思路,就是打印两个三角形。一个朝上的等要三角形和一个朝下的等腰三角形,组合起来就是菱形。 代码: ...
这是上半个三角形: Console.Write("请输入一个数"); int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n;i++ ) { for (int b = 1; b <= n - i;b++ ) { Console.Wr ...
分类:
其他好文 时间:
2017-06-10 17:12:02
阅读次数:
184