#coding=utf-8#!/usr/bin/pythonimport sys;print("The command line parameters are : ");for i in range(0, len(sys.argv)) : print str(i) + ' -> ' +...
分类:
编程语言 时间:
2015-07-02 23:55:48
阅读次数:
162
#coding=utf-8#!/usr/bin/pythonfinal_list = ('a', 1, 'b', 2, 'c', 3);print final_list[0];print final_list[1:3];print final_list * 2;print final_list + ...
分类:
编程语言 时间:
2015-07-02 23:55:03
阅读次数:
158
#coding=utf-8#!/usr/bin/pythonimport logging;a = 'abc';print 'Y' if isinstance(a, str) else 'N';
分类:
编程语言 时间:
2015-07-02 23:54:30
阅读次数:
166
ini文件[weixin_info]hello = Nick Huang#coding=utf-8#!/usr/bin/pythonimport ConfigParser;cp = ConfigParser.ConfigParser();cp.read('027.99.config.ini');he...
分类:
编程语言 时间:
2015-07-02 23:54:16
阅读次数:
239
#coding=utf-8#!/usr/bin/pythonimport json;dict = {};dict['name'] = 'nick';dict['say'] = 'hello world...';dict['age'] = '20';dict_json = repr(dict);pri...
分类:
编程语言 时间:
2015-07-02 23:53:23
阅读次数:
238
#coding=utf-8#!/usr/bin/pythonstr1 = None;str2 = '';str3 = ' ';if str1 == None : print("str1 is none.");else : print("str1 is not none.");if str...
分类:
编程语言 时间:
2015-07-02 22:33:29
阅读次数:
163
#coding=utf-8#!/usr/bin/pythonlist = ['a', 1, 'b', 2, 'c', 3];print list[0];print list[1:3];print list * 2;print list + list + list;# 遍历print('for eac...
分类:
编程语言 时间:
2015-07-02 22:23:05
阅读次数:
553
001.print_hello_world#!/usr/bin/pythonprint "hello, world...";002.print_chinese#coding=gbk#!/usr/bin/pythonprint "你好吗"
分类:
编程语言 时间:
2015-07-02 22:18:40
阅读次数:
108
#from 《Python 2.7.9 documentation》Use 4-space indentation, and no tabs.#使用4空格缩进,不要使用tab缩进Wrap lines so that they don’t exceed 79 characters.拆行确保每行不超过7...
分类:
编程语言 时间:
2015-07-02 22:16:39
阅读次数:
154
1. 写入并生成csv文件代码:# coding: utf-8import csvcsvfile = file('csv_test.csv', 'wb')writer = csv.writer(csvfile)writer.writerow(['姓名', '年龄', '电话'])data = [ (...
分类:
编程语言 时间:
2015-07-02 17:02:24
阅读次数:
135