Python教程

Python教程:包含了所有代写案例以及部分答案

  • # encoding=utf-8 def printInfo(info): print unicode(info, ‘utf-8’).encode(‘gbk’) class Person(): name = "" def __init__(self, name): self.name = name; return; def Show(self): printInfo("zhuangbanhao%s" % self.name) class Finery(Pe … 继续阅读“python的设计模式”

    :
  • #!/usr/bin/env python # -*- coding: utf-8 -*- ‘ a test module ‘ __author__ = ‘test’ import sys def test(): args = sys.argv if len(args)==1: print ‘Hello, world!’ elif len(args)==2: print ‘Hello, %s!’ % args[1] else: print ‘Too many arguments!’ if __n … 继续阅读“python helloworld”

    :