码迷,mamicode.com
首页 >  
搜索关键字:python2.7 tab自动补全 readline    ( 2135个结果
mysql 5.5 导入数据 和 [【乱码解决
今日导入数据到阿里云上的mysql 5.5,遇到乱码问题,参考了网上不少相关帖子,顺便记录下来,供参考: # mysql --version mysql  Ver 14.14 Distrib 5.5.40, for linux2.6 (x86_64) using readline 5.1   1)先查看编码信息: mysql> show variables like 'characte...
分类:数据库   时间:2015-01-26 00:07:10    阅读次数:378
图书借阅的小案例
这个小案例,主要练习类和方法的创建与调用void Main(){ while (true) { Console.WriteLine ("请输入标题或作者"); var key = Console.ReadLine().Trim(); Li...
分类:其他好文   时间:2015-01-24 22:32:24    阅读次数:216
[CSharp]1 占位符、转义字符
C# PlaceholderThere are 2 ways to output multiple characters in C#.One:static void Main(){ string c=Console.ReadLine(); string d=Console.ReadLine();Co...
分类:其他好文   时间:2015-01-24 19:57:54    阅读次数:250
shell IFS readLine.sh
processLine() { line="$@" echo $line } FILE="" if [ "$1" == "" ]; then FILE="/dev/stdin" else FILE="$1" if [ ! -f $FILE ]; then echo "$FILE : does not exists" exit 1 ...
分类:系统相关   时间:2015-01-23 20:07:29    阅读次数:242
read, readline, readlines
read读取指定长度,返回字符串readline 每次读取一行readlines 将整个文件读取到内存中。对于大文件(大于内存)的处理,readline的一行行迭代影响效率。网上看到有个老外给了个很不错的处理办法:import iodef readInChunks(fileObj, chunkSiz...
分类:其他好文   时间:2015-01-23 17:50:33    阅读次数:223
centos升级python(从2.6.6升级到2.7.8)
***先安装readline,否则升级后python回退和方向键不能使用yum install readline-devel.x86_641.#wget www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz2.#tar zxvf Python-2.7.8....
分类:编程语言   时间:2015-01-19 12:47:18    阅读次数:215
文件---Python
---恢复内容开始---读取文件:fin=open("test.txt")read=fin.readline()-----读一行for line in fin: print (line) fin.close()read=fin.read()----读取所有内容写入文件:fout=open('test...
分类:编程语言   时间:2015-01-17 12:40:48    阅读次数:160
centos上安装Python3.4——源码安装
1、安装Python的依赖包 yum groupinstall "Development tools" yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel 2、...
分类:编程语言   时间:2015-01-16 16:49:04    阅读次数:294
Python在Linux系统下的tab补齐
#!/usr/bin/envpython#_*_coding:utf-8_*_importsysimportosimportreadlineimportrlcompleterimportatexitreadline.parse_and_bind(‘tab:complete‘)histfile=os.path.join(os.environ[‘HOME‘],‘.pythonhistory‘)try:readline.read_history_file(histfile)exceptIOError:passate..
分类:编程语言   时间:2015-01-13 17:55:32    阅读次数:160
python读取中文文件编码问题
python 读取中文文件后,作为参数使用,经常会遇到乱码或者报错asii错误等。我们需要对中文进行decode('gbk')如我有一个data.txt文件有如下内容:百度谷歌现在想读取文件中内容构建查询语句代码如下:f=open('data.txt','r')for i in f.readline...
分类:编程语言   时间:2015-01-08 17:24:21    阅读次数:159
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!