예제 #1
0
X = 11  # My X: global to this file only

import moda  # Gain access to names in moda
moda.f()  # Sets moda.X, not this file's X
print(X, moda.X)
예제 #2
0
#!/usr/bin/env python
# coding: utf-8
X = 11

import moda
moda.f()
print X, moda.X
예제 #3
0
X = 11  # My X: global to this file only

import moda  # Gain access to names in moda

moda.f()  # Sets moda.X, not this file's X
print(X, moda.X)
예제 #4
0
파일: modb.py 프로젝트: qiupq/LearnPython
X = 11               # my X: global to this file only

import moda          # gain access to names in moda
moda.f()             # sets moda.X, not my X
print X, moda.X
예제 #5
0
X = 11  # 내 X: 이 파일에서만 전역

import moda  # moda의 이름들에 대한 접근 권한을 갖게 됨
moda.f()  # 이 파일의 X가 아니라 moda.X를 설정
print(X, moda.X)

# pythonb modb.py
# 11 99
예제 #6
0
X = 11

print X
from moda import X, f
f()
print X
예제 #7
0
x = 11  # meu x: global apenas para esse arquivo

import moda  # obtem acesso aos nomes presentes em moda
moda.f()  # configura moda.x e não meu x
print(x)  # 11
print(moda.x)  # 99
예제 #8
0
#!/usr/bin/env python3
#encoding=utf-8

#-------------------------------------------------------
# Usage: python3 modb.py
# Description: module basic and scope
#-------------------------------------------------------

x = 11  # x, global to this file only

import moda  # Gain access to names in moda

moda.f()  # Sets moda.x, not this file's x

print(x, moda.x)  # print 11 99