python module

巴扎黑
Release: 2016-12-09 14:32:51
Original
1269 people have browsed it

Modules: self-contained and organized snippets of code
Import: the operation of appending properties from other modules to your module

imptee.py

Python code

foo='abc'  
def show():  
    print 'foo from imptee:',foo  
impter.py
Copy after login

Python code

import imptee  
from imptee import foo,show  
show()  
foo = 123  
print 'foo from impter:',foo  
show()  
print 'imptee.foo:',imptee.foo  
foo from imptee: abc foo from impter: 123 foo from imptee: abc imptee.foo: abc
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template