python 学习
来源:互联网 发布:淘口令打开淘宝没反应 编辑:程序博客网 时间:2024/06/05 10:58
'''
Created on 2012-5-9
@author: Administrator
'''
#def foo():
# return ['xyz',10000, -98.6]
#print foo()
#def bar():
# return 'abc',[42,'python'],"Guido"
#def bar2():
# return ('abc',[42,'python'],"Guido")
#
#print bar()
#print bar2()
#def foo(x):
# print x
#foo(42)
#foo('bar')
#foo(y)
#def foo():
# 'foo() --properly created doc string'
#def bar():
# pass
##bar.__doc__='ops,forgot the doc str above'
##bar.version=0.1
##print bar.__doc__
##print bar.version
##help(foo)
#print foo.__dict__
#def foo():
# def bar():
# print 'bar() called'
#
# print 'foo() called'
# bar()
#
#bar=foo
#bar()
#def taxMe(const,rate=0.0825):
# return const+(const*rate)
#
#print taxMe(100)
#print taxMe(100,0.05)
#print taxMe(20, 33)
#
#def true():return True
#true= lambda : True
#print true()
#print true
#a = lambda x,y=2:x+y
#print a(3)
#print a(3,5)
#b=lambda *z:z
#print b(23,'zyx')
#from random import randint
#def odd(n):
# return n % 2
#
#allNums = []
#for eachNum in range(9):
# allNums.append(randint(1,99))
# print filter(odd, allNums)
#def map(func,seq):
# mapped_seq=[]
# for eachItem in seq:
# mapped_seq.append(eachItem)
# return mapped_seq
#print map((lambda x:x+2),[0,1,2,3,4,5])
#def foo():
# print '\ncalling foo()'
# bar=200
# print 'in foo(),bar is ',bar
#bar=100
#print 'in __main__,bar is ',bar,foo()
#print '\nin __main__,bar is (still)',bar
#is_this_global='xyz'
#def foo():
# global is_this_global
# this_is_local='abc'
# is_this_global='def'
# print this_is_local+is_this_global
#
#foo()
#
#print is_this_global
#from pickle import OBJ
#def counter(start_at=0):
# count=[start_at]
# def incr():
# count[0]+=1
# return count[0]
# return incr
#count=counter(5)
#print count()
#print count()
#import __future__
#def simpleGen():
# yield 1
# yield '2-->punch!'
#
#myG=simpleGen()
#print myG.next()
#print myG.next()
#print myG.next()
#import sys
#print sys.api_version
#print sys.byteorder
#print sys.builtin_module_names
#print sys.callstats()
#print sys.copyright
#print sys.exc_info()
#print sys.stderr
#print sys.stdin
#print sys.stdout
#print sys.winver
#print sys.warnoptions
#print sys.version_info
#print sys.prefix
#print sys.path
#print sys.platform
#print sys.path_hooks
#print sys.path
#sys.path.append(r'c:\windows')
#print sys.path
#class AddrBookEntry(object):
# 'address book entry class'
# def __init__(self,nm,ph):
# self.name=nm
# self.phone=ph
# print 'Created instance for:',self.name
# def updatePhone(self,newph):
# self.phone=newph
# print 'Updated phone# for :',self.name
##jone=AddrBookEntry('John Doe','408-555-1212')
##jane=AddrBookEntry('Jane Doe','650-555-1212')
#
##print jone
##print jone.name
##print jone.phone
##print jane.name
##print jane.phone
##jone.updatePhone('415-555-1212')
##print jone.phone
#
#class EmplAddrBookEntry(AddrBookEntry):
# def __init__(self,nm,ph,id,em):
# AddrBookEntry.__init__(self,nm,ph)
# self.empid=id
# self.email=em
# def updateEmail(self,newem):
# self.email=newem
# print 'Updated e_mail address for:',self.name
#
#john=EmplAddrBookEntry('john doe','408-5555-78',42,'john@spam.doe')
#print john
#print john.name
#print john.phone
#print john.email
#john.updatePhone('414-4444-4444')
#print john.phone
#john.updateEmail('john@doe.spam.eeee')
#print john.email
#EmplAddrBookEntry.__class__
#EmplAddrBookEntry.__dict__
#EmplAddrBookEntry.__doc__
##EmplAddrBookEntry.__sizeof__()
#
#class C():
# versin=1.2
#c=C()
##print C.versin
##print c.versin
#c.versin +=0.1
##C.versin +=0.1
##print C.versin
##print c.versin
#c.versin+=0.1
##print C.versin
#print c.versin
#class Foo():
# x=1.5
#
#foo=Foo()
#print foo.x
#foo.x=1.7
#print foo.x
#del foo.x
#print foo.x
#print Foo.x
#
#foo.x+=.2
#print foo.x
#print Foo.x
#class Foo():
# x={2003:'poe2'}
#foo=Foo()
#print foo.x
#foo.x[2004]='valid path'
#print foo.x
#print Foo.x
#del foo.x
#class TestStaticMethod:
# def foo():
# print 'calling static method foo()'
# foo=staticmethod(foo)
#
#class TestClassMethod:
# def foo(cls):
# print 'calling class method foo()'
# print 'foo() is part of class :',cls.__name__
# foo = classmethod(foo)
#
#
#tsm=TestStaticMethod()
#TestStaticMethod.foo()
#tsm.foo()
#class P(object):
# def foo(self):
# print 'Hi, i am p_foo()'
#p=P()
#p.foo()
#class C(P):
# def foo(self):
# print 'Hi , i am C-foo()'
#c=C()
#c.foo()
#
#P.foo(c)
#class C(P):
# def foo(self):
# P.foo(self)
# print 'Hi , i am C-foo()'
#class C(P):
# def foo(self):
# super(C,self).foo()
# print 'Hi, c_foo()'
#
#
#c=C()
#c.foo()
#class P1:
# def foo(self):
# print 'called p1'
#class P2:
# def foo(self):
# print 'called p2'
# def bar(self):
# print 'called p2-bar()'
#class C1(P1,P2):
# pass
#class C2(P1,P2):
# def bar(self):
# print 'called c2-bar()'
#class GC(C1,C2):
# pass
#gc=GC()
#gc.foo()
#gc.bar()
#C2.bar(gc)
#class myClass(object):
# def __init__(self):
# self.foo=100
#myInst=myClass()
#print hasattr(myInst, 'foo')
#print getattr(myInst, 'foo')
#print hasattr(myInst, 'bar')
#print getattr(myInst, 'bar')
#print getattr(myInst,'bar','oops!')
#setattr(myInst, 'bar', 'foo')
#print dir(myInst)
#print hasattr(myInst, 'foo')
#print hasattr(myInst, 'aa')
#class C(object):
# pass
#c=C()
#c.foo=100
#c.bar='Python'
#print c.__dict__
#
#print vars(c)
#print callable(type)
#print callable(1)
#def foo():
# pass
#print callable(foo)
#print callable('bar')
#class C(object):
# pass
#print callable(C)
#eval_code=compile('100+200', "", 'eval')
#print eval(eval_code)
#
#single_code=compile('print "hello world1"', '', 'single')
#exec single_code
#exec_code=compile("""
#req= input('Count how manay number?')
#for eachNum in range(req):
# print eachNum
# """
#, '', 'exec')
#exec exec_code
#print eval('932')
#print int('932')
#print eval('100+200')
#aString = raw_input('enter a list:')
#print aString
#print type(aString)
#
#aString1 = input('enter a list:')
#print aString1
#
#import os
#result=os.system('dir')
#print result
#
#import os
#f= os.popen('uname -a')
#data=f.readline()
#f.close()
#print data,
#from urllib2 import urlopen
#u=urlopen('http://novel.hongxiu.com/a/366144/4243480.shtml')
#for row in u:
# print row
#import urllib2
#import sys
#
#content = urllib2.urlopen('http://www.txtbbs.com/txt-7785-2899015.html').read() #the webpage is encoded by uft-8
#
#type=sys.getfilesystemencoding() #important
#print type
#print content.decode("gb2312").encode(type) #important
#import win32com.client
#
#o = win32com.client.Dispatch("Excel.Application")
#o.Visible = True
#o.Workbooks.Add()
#o.Cells(1,1).Value = "Python!"
for i in range(3,8):
print i
Created on 2012-5-9
@author: Administrator
'''
#def foo():
# return ['xyz',10000, -98.6]
#print foo()
#def bar():
# return 'abc',[42,'python'],"Guido"
#def bar2():
# return ('abc',[42,'python'],"Guido")
#
#print bar()
#print bar2()
#def foo(x):
# print x
#foo(42)
#foo('bar')
#foo(y)
#def foo():
# 'foo() --properly created doc string'
#def bar():
# pass
##bar.__doc__='ops,forgot the doc str above'
##bar.version=0.1
##print bar.__doc__
##print bar.version
##help(foo)
#print foo.__dict__
#def foo():
# def bar():
# print 'bar() called'
#
# print 'foo() called'
# bar()
#
#bar=foo
#bar()
#def taxMe(const,rate=0.0825):
# return const+(const*rate)
#
#print taxMe(100)
#print taxMe(100,0.05)
#print taxMe(20, 33)
#
#def true():return True
#true= lambda : True
#print true()
#print true
#a = lambda x,y=2:x+y
#print a(3)
#print a(3,5)
#b=lambda *z:z
#print b(23,'zyx')
#from random import randint
#def odd(n):
# return n % 2
#
#allNums = []
#for eachNum in range(9):
# allNums.append(randint(1,99))
# print filter(odd, allNums)
#def map(func,seq):
# mapped_seq=[]
# for eachItem in seq:
# mapped_seq.append(eachItem)
# return mapped_seq
#print map((lambda x:x+2),[0,1,2,3,4,5])
#def foo():
# print '\ncalling foo()'
# bar=200
# print 'in foo(),bar is ',bar
#bar=100
#print 'in __main__,bar is ',bar,foo()
#print '\nin __main__,bar is (still)',bar
#is_this_global='xyz'
#def foo():
# global is_this_global
# this_is_local='abc'
# is_this_global='def'
# print this_is_local+is_this_global
#
#foo()
#
#print is_this_global
#from pickle import OBJ
#def counter(start_at=0):
# count=[start_at]
# def incr():
# count[0]+=1
# return count[0]
# return incr
#count=counter(5)
#print count()
#print count()
#import __future__
#def simpleGen():
# yield 1
# yield '2-->punch!'
#
#myG=simpleGen()
#print myG.next()
#print myG.next()
#print myG.next()
#import sys
#print sys.api_version
#print sys.byteorder
#print sys.builtin_module_names
#print sys.callstats()
#print sys.copyright
#print sys.exc_info()
#print sys.stderr
#print sys.stdin
#print sys.stdout
#print sys.winver
#print sys.warnoptions
#print sys.version_info
#print sys.prefix
#print sys.path
#print sys.platform
#print sys.path_hooks
#print sys.path
#sys.path.append(r'c:\windows')
#print sys.path
#class AddrBookEntry(object):
# 'address book entry class'
# def __init__(self,nm,ph):
# self.name=nm
# self.phone=ph
# print 'Created instance for:',self.name
# def updatePhone(self,newph):
# self.phone=newph
# print 'Updated phone# for :',self.name
##jone=AddrBookEntry('John Doe','408-555-1212')
##jane=AddrBookEntry('Jane Doe','650-555-1212')
#
##print jone
##print jone.name
##print jone.phone
##print jane.name
##print jane.phone
##jone.updatePhone('415-555-1212')
##print jone.phone
#
#class EmplAddrBookEntry(AddrBookEntry):
# def __init__(self,nm,ph,id,em):
# AddrBookEntry.__init__(self,nm,ph)
# self.empid=id
# self.email=em
# def updateEmail(self,newem):
# self.email=newem
# print 'Updated e_mail address for:',self.name
#
#john=EmplAddrBookEntry('john doe','408-5555-78',42,'john@spam.doe')
#print john
#print john.name
#print john.phone
#print john.email
#john.updatePhone('414-4444-4444')
#print john.phone
#john.updateEmail('john@doe.spam.eeee')
#print john.email
#EmplAddrBookEntry.__class__
#EmplAddrBookEntry.__dict__
#EmplAddrBookEntry.__doc__
##EmplAddrBookEntry.__sizeof__()
#
#class C():
# versin=1.2
#c=C()
##print C.versin
##print c.versin
#c.versin +=0.1
##C.versin +=0.1
##print C.versin
##print c.versin
#c.versin+=0.1
##print C.versin
#print c.versin
#class Foo():
# x=1.5
#
#foo=Foo()
#print foo.x
#foo.x=1.7
#print foo.x
#del foo.x
#print foo.x
#print Foo.x
#
#foo.x+=.2
#print foo.x
#print Foo.x
#class Foo():
# x={2003:'poe2'}
#foo=Foo()
#print foo.x
#foo.x[2004]='valid path'
#print foo.x
#print Foo.x
#del foo.x
#class TestStaticMethod:
# def foo():
# print 'calling static method foo()'
# foo=staticmethod(foo)
#
#class TestClassMethod:
# def foo(cls):
# print 'calling class method foo()'
# print 'foo() is part of class :',cls.__name__
# foo = classmethod(foo)
#
#
#tsm=TestStaticMethod()
#TestStaticMethod.foo()
#tsm.foo()
#class P(object):
# def foo(self):
# print 'Hi, i am p_foo()'
#p=P()
#p.foo()
#class C(P):
# def foo(self):
# print 'Hi , i am C-foo()'
#c=C()
#c.foo()
#
#P.foo(c)
#class C(P):
# def foo(self):
# P.foo(self)
# print 'Hi , i am C-foo()'
#class C(P):
# def foo(self):
# super(C,self).foo()
# print 'Hi, c_foo()'
#
#
#c=C()
#c.foo()
#class P1:
# def foo(self):
# print 'called p1'
#class P2:
# def foo(self):
# print 'called p2'
# def bar(self):
# print 'called p2-bar()'
#class C1(P1,P2):
# pass
#class C2(P1,P2):
# def bar(self):
# print 'called c2-bar()'
#class GC(C1,C2):
# pass
#gc=GC()
#gc.foo()
#gc.bar()
#C2.bar(gc)
#class myClass(object):
# def __init__(self):
# self.foo=100
#myInst=myClass()
#print hasattr(myInst, 'foo')
#print getattr(myInst, 'foo')
#print hasattr(myInst, 'bar')
#print getattr(myInst, 'bar')
#print getattr(myInst,'bar','oops!')
#setattr(myInst, 'bar', 'foo')
#print dir(myInst)
#print hasattr(myInst, 'foo')
#print hasattr(myInst, 'aa')
#class C(object):
# pass
#c=C()
#c.foo=100
#c.bar='Python'
#print c.__dict__
#
#print vars(c)
#print callable(type)
#print callable(1)
#def foo():
# pass
#print callable(foo)
#print callable('bar')
#class C(object):
# pass
#print callable(C)
#eval_code=compile('100+200', "", 'eval')
#print eval(eval_code)
#
#single_code=compile('print "hello world1"', '', 'single')
#exec single_code
#exec_code=compile("""
#req= input('Count how manay number?')
#for eachNum in range(req):
# print eachNum
# """
#, '', 'exec')
#exec exec_code
#print eval('932')
#print int('932')
#print eval('100+200')
#aString = raw_input('enter a list:')
#print aString
#print type(aString)
#
#aString1 = input('enter a list:')
#print aString1
#
#import os
#result=os.system('dir')
#print result
#
#import os
#f= os.popen('uname -a')
#data=f.readline()
#f.close()
#print data,
#from urllib2 import urlopen
#u=urlopen('http://novel.hongxiu.com/a/366144/4243480.shtml')
#for row in u:
# print row
#import urllib2
#import sys
#
#content = urllib2.urlopen('http://www.txtbbs.com/txt-7785-2899015.html').read() #the webpage is encoded by uft-8
#
#type=sys.getfilesystemencoding() #important
#print type
#print content.decode("gb2312").encode(type) #important
#import win32com.client
#
#o = win32com.client.Dispatch("Excel.Application")
#o.Visible = True
#o.Workbooks.Add()
#o.Cells(1,1).Value = "Python!"
for i in range(3,8):
print i
- 【Python学习】Python 关键字
- Python学习----Python基础
- 【python】:python学习笔记
- Python:Python学习总结
- Python学习-Python数据类型
- Python学习
- 学习python
- python学习
- 学习Python
- python学习
- python学习
- python学习
- python 学习
- 学习python
- Python学习
- Python 学习
- python学习
- Python学习
- 交换机 路由器和集线器的区别
- 新创网站这样开发才够快
- 图片热区,使图片的某个位置可以点击链接到其他页面
- Oracle create tablespace 创建表空间语法详解
- blog
- python 学习
- error: 'QSslSocket'
- SQL Server中行列转换 Pivot UnPivot
- oracle禁止OS本地密码验证
- POJ 3185 (The Water Bowls)
- Java学习札记2:Java中的算术运算符
- C++基本数据类型和运算符知识点汇总
- 代码规范的那些事儿
- 黑马程序员--WinForm进阶自学总结