上一页 1 ··· 202 203 204 205 206 207 208 209 210 ··· 430 下一页

2013年7月23日

python random模块

摘要: Python中的random模块用于生成随机数。下面介绍一下random模块中最常用的几个函数。 random.randomrandom.random()用于生成一个0到1的随机符点数: 0 b,则生成的随机数n: a #10-12的随机数 print random.randint(... 阅读全文

posted @ 2013-07-23 17:04 岚之山 阅读(95) 评论(0) 推荐(0)

详解Python模块导入方法

摘要: python常被昵称为胶水语言,它能很轻松的把用其他语言制作的各种模块(尤其是C/C++)轻松联结在一起。python包含子目录中的模块方法比较简单,关键是能够在sys.path里面找到通向模块文件的路径。 下面将具体介绍几种常用情况: (1)主程序与模块程序在同一目录下: 如下面程序结构: `... 阅读全文

posted @ 2013-07-23 17:04 岚之山 阅读(133) 评论(0) 推荐(0)

python之强大的日志模块

摘要: 1.简单的将日志打印到屏幕 import logginglogging.debug('This is debug message')logging.info('This is info message')logging.warning('This is warning message... 阅读全文

posted @ 2013-07-23 17:04 岚之山 阅读(144) 评论(0) 推荐(0)

ATS项目更新(2) 命令行编译Studio解决方案

摘要: 1: rem "D:\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat" 2: D: 3: cd ..\..\..\..\..\..\..\..\..\..\..\..\ 4: cd "D:\Microsoft Visual St... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(168) 评论(0) 推荐(0)

python 教程 第二十一章、 扩展Python

摘要: 第二十一章、 扩展Python /* D:\Python27\Lib\Extest-1.0\Extest2.c */ #include #include #include #include "Python.h" int fac(int n) { if (n... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(191) 评论(0) 推荐(0)

python 教程 第十九章、 图形界面编程

摘要: 第十九章、 图形界面编程 import Tkinter top = Tkinter.Tk() hello = Tkinter.Label(top, text='Hello World!') hello.pack() quit = Tkinter.Button(top, text='Q... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(93) 评论(0) 推荐(0)

python 教程 第十八章、 Web编程

摘要: 第十八章、 Web编程 import urllib2 LOGIN = 'jin' PASSWD = 'Welcome' URL = 'https://tlv-tools-qc:8443/qcbin/start_a.htm' def handler_version(url): ... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(90) 评论(0) 推荐(0)

python 教程 第十七章、 网络编程

摘要: 第十七章、 网络编程 1) FTP客户端 import ftplib import os import socket HOST = '127.0.0.1' DIRN = 'menus' FILE = 'hello.txt' USER = 'taojin' PASS = '... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(96) 评论(0) 推荐(0)

python 教程 第十章、 输入/输出

摘要: 第十章、 输入/输出 1) 文件 poem = '''Programming is fun use Python!''' f = file('poem.txt', 'w') # open for 'w'riting f.write(poem) # write text to file ... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(127) 评论(0) 推荐(0)

python 教程 第九章、 类与面向对象

摘要: 第九章、 类与面向对象 1) 类 基本类/超类/父类被导出类或子类继承。 Inheritance继承 Inheritance is based on attribute lookup in Python (in X.name expressions). Polymorphism多态 In X... 阅读全文

posted @ 2013-07-23 17:03 岚之山 阅读(126) 评论(0) 推荐(0)

上一页 1 ··· 202 203 204 205 206 207 208 209 210 ··· 430 下一页

导航