/* * 1,尝试定义一个继承Thread类的类,并覆盖run()方法, * 在run()方法中每隔100毫秒打印一句话.*/ package Stream; //方法一 继承Thread 实现多线程 public class TestX extends Thread { public void run () { xiancheng();} public void xiancheng() { for (int i = 0; i < 10; i++) { System.out.println(th…
#python 学习笔记 2017/07/13 # !/usr/bin/env python3 # -*- conding:utf-8 -*- #从高阶函数的定义,我们可以知道,把函数作为参数的函数,把函数作为返回值的参数都是高阶函数 #可变参数求和 def calc_sum(*args): sum = 0 for n in args: sum = sum + n return sum #这个函数会立即返回求和结果,如果不要立即返回求和结果,而是需要在计算,可以返回求和函数,当再次调用时才给出计…
#python学习笔记 17/07/10 # !/usr/bin/evn python3 # -*- coding:utf-8 -*- import math #函数 函数的 定义 #定义一个求绝对值函数 def abstruct(a): if not isinstance (a, (int, float)): raise TypeError("param must be a int or float type") if a >= 0: return a else: return…
根据http://www.oschina.net/code/snippet_70229_2407修改而来的增强版.貌似原版源自Axel这个多线程下载工具. ''' Created on 2014-10-24 @author: Maple ''' import sys import os import time import getopt import urllib.request import urllib.parse from threading import Thread #========…
1.list can hold arbitrary objects and can expand dynamically as new items are added. A list is an ordered set of items. 2.A tuple is an immutable list. A tuple can not be changed in any way once it is created. 3.A set is an unordered “bag” of…