# file_a.py-----------------
# def my_idpw():
# my_id="miero"
# my_pw="1234"
# return my_id,my_pw # tuple
# def my_id():
# my_id="miero"
# return my_id
# def my_pw():
# my_pw="1234"
# return my_pw
# ---------------------------
# *******************************
import file_a # import 파일명
a=file_a.my_idpw()[0] # tuple 파일.함수명()[첫번째]
b=file_a.my_idpw()[-1] # tuple 파일.함수명()[마지막]
print(a)
print(b)
c=file_a.my_id()
d=file_a.my_pw()
print(c)
print(d)
# *******************************
from file_a import my_id,my_pw # from 파일명 import 함수
c=my_id() # 함수명()
d=my_pw() # 함수명()
print(c)
print(d)
'컴퓨터 > Python' 카테고리의 다른 글
python pyside2 MainWindow setWindowIcon (0) | 2020.11.07 |
---|---|
pyside2 공부일지 (0) | 2020.10.31 |
PyQt5나 PySide2를 구동하려면 올바른 plugins 경로가 지정되어야 한다. (0) | 2020.10.29 |
pyside2 파이썬클래스 (0) | 2020.10.29 |
python xls파일 xlsx파일로 변환해서 DataFrame으로 보기 (0) | 2020.10.28 |