上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: #!/usr/bin/python# Filename: objvar.pyclass Person: '''Represents a person.''' population = 0 def __init__(self, name): '''Initializes the person's da 阅读全文
posted @ 2017-10-19 00:16 真勇士王小山 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# Filename: class_init.pyclass Person: def __init__(self, name): self.name = name def sayHi(self): print 'Hello, my name is', self.na 阅读全文
posted @ 2017-10-19 00:09 真勇士王小山 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# Filename: method.pyclass Person: def sayHi(self): print 'Hello, how are you?'p = Person()p.sayHi()# This short example can also be 阅读全文
posted @ 2017-10-19 00:06 真勇士王小山 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python# Filename: str_methods.py name = 'Swaroop' # This is a string object if name.startswith('Swa'): print 'Yes, the string starts with " 阅读全文
posted @ 2017-10-18 21:07 真勇士王小山 阅读(122) 评论(0) 推荐(0) 编辑
摘要: # Filename: reference.py print 'Simple Assignment'shoplist = ['apple', 'mango', 'carrot', 'banana']mylist = shoplist # mylist is just another name poi 阅读全文
posted @ 2017-10-18 21:05 真勇士王小山 阅读(78) 评论(0) 推荐(0) 编辑
摘要: # Filename: using_dict.py # 'ab' is short for 'a'ddress'b'ook ab={ 'Swaroop' : 'swaroopch@byteofpython.info', 'Larry' : 'larry@wall.org', 'Matsumoto' 阅读全文
posted @ 2017-10-18 21:01 真勇士王小山 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #/usr/bin/env puthon (1)起始行(只有咋UNIX环境下使用,用来直接通过文件名来执行文件) “”“this is a test module” (2)模块文档(文档字符串) import sys import os (3)模块导入 debug=Ture (4)全局变量 clas 阅读全文
posted @ 2017-10-18 12:56 真勇士王小山 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 一,CAN总线基础知识: 总线状态总线有“显性”和“隐性”两个状态,“显性”对应逻辑“0”,“隐性”对应逻辑“1”。“显性”状态和“隐性”状态相与的结果为“显性”状态,所以两个节点同时分别发送“0”和“1”时,总线上呈现“0”。也就是说在总线上显性电平具有优先权,只有所有的单元都输出隐性电平,总线上 阅读全文
posted @ 2017-10-11 09:29 真勇士王小山 阅读(4826) 评论(0) 推荐(0) 编辑
摘要: Python 基础教程 Python是一种解释型、面向对象、动态数据类型的高级程序设计语言。 Python下环境搭建 Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到: Python官网:http://www.python.org/ Python包管理器下载及安装 a) 查 阅读全文
posted @ 2017-10-10 11:07 真勇士王小山 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1 你好 #打开新窗口,输入:#! /usr/bin/python# -*- coding: utf8 -*- s1=input("Input your name:")print("你好,%s" % s1)'''知识点: * input("某字符串")函数:显示"某字符串",并等待用户输入. * p 阅读全文
posted @ 2017-10-10 11:07 真勇士王小山 阅读(199) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页