当前位置:编程学习 > python >>

一口气python ABC2

first.py
Python代码 
def show(params): 
    return ";".join(["%s=%s" % (k, v) for k, v in params.items()]) 
 
class First: 
    def show(self,params): 
        return " ".join(["%s=%s" % (k, v) for k, v in params.items()]) 
 
second.py
Python代码 
import first 
 
conn={"language":"python","framework":"Django"}; 
result = first.show(conn) 
print result 
 
myfirst = first.First() 
result1=myfirst.show(conn) 
print result1 
 
framework=Django;language=python
framework=Django
language=python
补充:Web开发 , Python ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,