码迷,mamicode.com
首页 >  
搜索关键字:python 循环 for...in while range    ( 199568个结果
Mac OS X中搭建Python科学计算环境
这个日志也是参考了几位网友的经验(例如这篇日志:http://blog.csdn.net/waleking/article/details/7578517)。他们推荐使用Mac Ports这样的软件来管理和安装所有的安装包。按照这里的教程:http://www.macports.org/install.php,需要首先安装Xcode,如果下载网速不好的话,使用浏览器下载可能需要数个小时。这里建...
分类:编程语言   时间:2014-07-22 23:05:34    阅读次数:354
Linux shell脚本中shift的用法说明
Linux shell脚本中shift的用法说明 shift命令用于对参数的移动(左移)。 示例1:依次读取输入的参数并打印参数个数: run.sh: #!/bin/bash while [ $# != 0 ];do echo "第一个参数为:$1,参数个数为:$#" shift done 输入如下命令运行:run.sh a b c d e...
分类:系统相关   时间:2014-05-01 22:06:54    阅读次数:475
解决eclipse编辑python程序的SyntaxError: Non-ASCII character错误
错误信息如下: File "E:\work\pydev\pythodemo\src\code\string.py", line 1 SyntaxError: Non-ASCII character '\xe5' in file E:\work\pydev\pythodemo\src\code\string.py on line 1, but no encoding declared; see ...
分类:编程语言   时间:2014-05-01 22:00:23    阅读次数:440
第一个 Python 程序 - Email Manager Demo
看了一些基础的 Python 入门教程后,深深感觉到 Python 的简洁与强大,这是我的第一个 Python Demo。以下是完整代码与运行截图。 代码: # encoding: utf-8 ''' @author: Techzero @email: techzero@163.com @time: 2014-4-30 下午1:31:04 ''' import os import sys im...
分类:编程语言   时间:2014-04-30 22:18:39    阅读次数:433
Python的包管理工具distribute,setuptools,easy_install与pip
刚开始学习Python时,看资料和别人介绍中提到过,安装Python的包有的用easy_install, setuptools, 有的使用pip,distribute。现在把这些相关的资料整理一下,能更清晰的了解Python的设计,关于这些可以参考http://guide.python-distribute.org/installation.html。...
分类:编程语言   时间:2014-04-29 13:42:22    阅读次数:358
Perl生成excel文件
#生成excel #ljl use Spreadsheet::WriteExcel; my %us; while(($key, $value) = each %us){ print "$key|$value\n"; } # 创建一个新的EXCEL文件 my $workbook = Spreadsheet::WriteExcel->new('poi_count_top15....
分类:其他好文   时间:2014-04-29 13:33:21    阅读次数:327
[TroubleShooting]Neither the partner nor the witness server instance for database is availble
Problem: You are trying to setup a mirroring on a Database called xxxDB(SQL server 2012). You are getting this error while trying to setup mirroring. “Neither the partner nor the witness server ins...
分类:数据库   时间:2014-04-29 13:33:20    阅读次数:444
链表《2》使用函数操作链表
使用函数操作链表 1:计算链表中结点的个数:定义一个Length_list()函数用于计算链表中结点的个数 函数代码: //计算链表中结点的个数 void Length_list(PNODE pHead) { PNODE p = pHead->pNext; int len = 0; while(NULL != p) { len++; p = p->pNext; ...
分类:其他好文   时间:2014-04-29 13:28:21    阅读次数:302
创建Hive/hbase相关联的表异常
FAILED: Error in metadata: java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 3 elements while hbase.columns.mapping has 4 elements (counting the key if implic...
分类:其他好文   时间:2014-04-29 13:17:21    阅读次数:387
python学习——编码
为了将各种不同的语言都包含在同一的字符集中,满足国际间的信息交流国际上制定了UNICODE字符集。 通过使用UNICODE字符集可以满足跨语言的文字处理,有效的避免乱码产生。 使用方法:在脚本中增加以下代码行之一 #-*- coding:utf-8 -*-#coding:utf-8 注意:如果是在命令行输出中文,则需要设定编码为cp936,文件格式保存为...
分类:编程语言   时间:2014-04-29 13:12:20    阅读次数:406
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!