摘要:
参数定义:1. 位置参数: 这是熟悉的标准化参数,位置参数必须在调用函数中定义的准确顺序来传递,在没有默认参数的情况下,传入参数 的精确数目必须和声明的数目一致。 def foo(who, name): print('{0} is {1}'.format(who, name) foo函数有两个位置参 阅读全文
摘要:
在python中方法传递的参数到底是值传递还是引用传递? 1. 首先需要知道python中变量的类型:Python的变量分为可变变量和不可变变量。 针对于不可变的类型比如string int 1 def change(str): 2 print('str {0} => id is {1}'.form 阅读全文
摘要:
在 http://www.cnblogs.com/someoneHan/p/6204640.html 线程一中对threading线程的开启调用做了简单的介绍 1 在线程开始之后,线程开始独立的运行直到目标函数返回为止。如果需要在主线程中判断开启的线程是否在运行可以使用 is_alive()方法: 阅读全文
摘要:
threading:基于对象和类的较高层面上的接口,threading模块在内部使用_thread模块来实现线程的对象以及常用的同步化工具的功能。 使用定制类的方式继承 threading.Thread基类 1. 在子类中需要override __init__ 和 run() 方法。 2. 当创建这 阅读全文
摘要:
python 线程之_thread _thread module: 基本用法: 1 def child(tid): 2 print("hello from child",tid) 3 _thread.start_new_thread(child,(1,) 1 使用_thread.start_new_ 阅读全文
摘要:
1. 安装ubuuntu 14.04之后python的默认版本为2.7.6但是我想使用python的版本为3.4 可以打开终端:输入:alias python = python3 阅读全文
摘要:
A view is a "type" of web page in the Django application that generally serves a specific function and has a specific template,for example you might h... 阅读全文
摘要:
WPF 使用VLC实现视频的播放:网上开源代码我复制了一份: https://github.com/someonehan/Vlc.DotNet1. 准备阶段 (I) libvlc.dll 和 libvlccore.dll 是必须的两个库 (II) 配合使用和还要有plugins文件夹下面的乱七八糟的... 阅读全文
摘要:
Recall that every python module has a built_in __name__ variable that python sets to the __main__ string only when the file is run as a program,not wh... 阅读全文
摘要:
To install mysql database in the ubuntu: 1.sudo apt-get install mysql-server 2.apt-get isntall mysql-client 3. sudo apt-get install libmysqlclient-... 阅读全文